[Mplayer-cvslog] CVS: main/libmpdemux demux_mkv.c,1.24,1.25

Moritz Bunkus CVS syncmail at mplayerhq.hu
Tue Sep 21 20:02:36 CEST 2004


CVS change done by Moritz Bunkus CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv19992

Modified Files:
	demux_mkv.c 
Log Message:
With the latest change to dec_audio.c (1.32) the demuxers have to set sh_a->samplesize to something != 0.

Index: demux_mkv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- demux_mkv.c	18 Sep 2004 14:35:19 -0000	1.24
+++ demux_mkv.c	21 Sep 2004 18:02:33 -0000	1.25
@@ -1794,33 +1794,36 @@
   sh_a->wf->nChannels = track->a_channels;
   sh_a->samplerate = (uint32_t) track->a_sfreq;
   sh_a->wf->nSamplesPerSec = (uint32_t) track->a_sfreq;
-  sh_a->samplesize = track->a_bps / 8;
+  if (track->a_bps == 0)
+    {
+      sh_a->samplesize = 2;
+      sh_a->wf->wBitsPerSample = 16;
+    }
+  else
+    {
+      sh_a->samplesize = track->a_bps / 8;
+      sh_a->wf->wBitsPerSample = track->a_bps;
+    }
   if (track->a_formattag == 0x0055)  /* MP3 || MP2 */
     {
       sh_a->wf->nAvgBytesPerSec = 16000;
       sh_a->wf->nBlockAlign = 1152;
-      sh_a->wf->wBitsPerSample = 0;
-      sh_a->samplesize = 0;
     }
   else if (!strncmp(track->codec_id, MKV_A_AC3, strlen(MKV_A_AC3)))
     {
       sh_a->wf->nAvgBytesPerSec = 16000;
       sh_a->wf->nBlockAlign = 1536;
-      sh_a->wf->wBitsPerSample = 0;
-      sh_a->samplesize = 0;
     }
   else if (track->a_formattag == 0x0001)  /* PCM || PCM_BE */
     {
       sh_a->wf->nAvgBytesPerSec = sh_a->channels * sh_a->samplerate*2;
       sh_a->wf->nBlockAlign = sh_a->wf->nAvgBytesPerSec;
-      sh_a->wf->wBitsPerSample = track->a_bps;
       if (!strcmp(track->codec_id, MKV_A_PCM_BE))
         sh_a->format = mmioFOURCC('t', 'w', 'o', 's');
     }
   else if (!strcmp(track->codec_id, MKV_A_QDMC) ||
            !strcmp(track->codec_id, MKV_A_QDMC2))
     {
-      sh_a->wf->wBitsPerSample = track->a_bps;
       sh_a->wf->nAvgBytesPerSec = 16000;
       sh_a->wf->nBlockAlign = 1486;
       track->fix_i_bps = 1;
@@ -1839,8 +1842,6 @@
 
       sh_a->wf->nAvgBytesPerSec = 16000;
       sh_a->wf->nBlockAlign = 1024;
-      sh_a->wf->wBitsPerSample = 0;
-      sh_a->samplesize = 0;
 
       /* Recreate the 'private data' */
       /* which faad2 uses in its initialization */
@@ -1899,7 +1900,6 @@
       ra4p = (real_audio_v4_props_t *) track->private_data;
       ra5p = (real_audio_v5_props_t *) track->private_data;
 
-      sh_a->wf->wBitsPerSample = sh_a->samplesize * 8;
       sh_a->wf->nAvgBytesPerSec = 0;  /* FIXME !? */
       sh_a->wf->nBlockAlign = be2me_16 (ra4p->frame_size);
 




More information about the MPlayer-cvslog mailing list