[MPlayer-dev-eng] [PATCH] trivial corrections for libdv

Kees Cook mplayer at outflux.net
Wed Oct 2 21:07:07 CEST 2002


Now I have an actual bugfix too.  I've updated the patch to include a test
for audio stream id == -2 (as set by mencoder during 3-pass encoding).  
Without this test, the audio demuxer overflows when doing the video
passes.

On Wed, Oct 02, 2002 at 09:45:55AM -0700, Kees Cook wrote:
> This just corrects a function name to match the other demuxer's
> "xxx_check_file" convention, adds a verbose note about (to match the other
> demuxers), adds "libdv" to the "input modules" list in "configure", and
> takes out the note about "for mencoder" since it's actually for both.  :)

-- 
Kees Cook                                            @outflux.net
-------------- next part --------------
diff -uNr MPlayer-20021002/configure MPlayer-20021002-kees/configure
--- MPlayer-20021002/configure	Tue Oct  1 15:36:25 2002
+++ MPlayer-20021002-kees/configure	Wed Oct  2 09:33:33 2002
@@ -3764,7 +3764,7 @@
   _nocodecmodules="libavcodec $_nocodecmodules"
 fi
 
-echocheck "libdv-0.9.5 (for mencoder)"
+echocheck "libdv-0.9.5+"
 if test "$_libdv" = auto ; then
   _libdv=no
   cat > $TMPC <<EOF
@@ -3776,8 +3776,10 @@
 if test "$_libdv" = yes ; then
   _def_libdv='#define HAVE_LIBDV095 1'
   _ld_libdv="-ldv"
+  _inputmodules="libdv $_codecmodules"
 else
   _def_libdv='#undef HAVE_LIBDV095'
+  _noinputmodules="libdv $_nocodecmodules"
 fi
 echores "$_libdv"
 
diff -uNr MPlayer-20021002/libmpdemux/demuxer.c MPlayer-20021002-kees/libmpdemux/demuxer.c
--- MPlayer-20021002/libmpdemux/demuxer.c	Sun Sep 29 12:26:40 2002
+++ MPlayer-20021002-kees/libmpdemux/demuxer.c	Wed Oct  2 09:21:10 2002
@@ -516,7 +516,7 @@
 int demux_open_roq(demuxer_t* demuxer);
 #ifdef HAVE_LIBDV095
 int demux_open_rawdv(demuxer_t* demuxer);
-extern int check_file_rawdv(demuxer_t *demuxer);
+extern int rawdv_check_file(demuxer_t *demuxer);
 #endif
 
 extern int vivo_check_file(demuxer_t *demuxer);
@@ -831,7 +831,7 @@
 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_RAWDV)
 {
    demuxer=new_demuxer(stream,DEMUXER_TYPE_RAWDV,audio_id,video_id,dvdsub_id);
-   if(check_file_rawdv(demuxer))
+   if(rawdv_check_file(demuxer))
    {
       mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_Detected_XXX_FileFormat,"RAWDV");
       file_format=DEMUXER_TYPE_RAWDV;
diff -uNr MPlayer-20021002/libmpdemux/demux_rawdv.c MPlayer-20021002-kees/libmpdemux/demux_rawdv.c
--- MPlayer-20021002/libmpdemux/demux_rawdv.c	Mon Aug  5 10:21:35 2002
+++ MPlayer-20021002-kees/libmpdemux/demux_rawdv.c	Wed Oct  2 11:54:33 2002
@@ -59,12 +59,15 @@
    frames->current_filepos=newpos*frames->frame_size;
 }
 
-int check_file_rawdv(demuxer_t *demuxer)
+int rawdv_check_file(demuxer_t *demuxer)
 {
    unsigned char tmp_buffer[DV_PAL_FRAME_SIZE];
    int bytes_read=0;
    int result=0;
    dv_decoder_t *td;
+
+   mp_msg(MSGT_DEMUX,MSGL_V,"Checking for DV\n");
+
    stream_reset(demuxer->stream);
    stream_seek(demuxer->stream, 0);
    bytes_read=stream_read(demuxer->stream,tmp_buffer,DV_PAL_FRAME_SIZE);
@@ -105,7 +108,7 @@
    dp_video->pos=frames->current_filepos;
    dp_video->flags=0;
 
-   if (demuxer->audio)
+   if (demuxer->audio && demuxer->audio->id!=-2)
 	{
       demux_packet_t* dp_audio=clone_demux_packet(dp_video);
       ds_add_packet(demuxer->audio,dp_audio);


More information about the MPlayer-dev-eng mailing list