[Mplayer-cvslog] CVS: main/libmpdemux demux_nuv.c,1.10,1.11

Arpi of Ize arpi at mplayerhq.hu
Mon Sep 30 23:10:53 CEST 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv26412

Modified Files:
	demux_nuv.c 
Log Message:
- demuxer->audio->id is set to -2 when using 'frameno.avi', so
  in that case, just skip audio packets.
- When processing NuppelVideo files with mencoder,
  remaining time, estimated size, etc. fields are not computed.
  SOLUTION: Update demuxer->filepos variable when reading the packets.
patch by Petr Pudlak <wandermind at centrum.cz>


Index: demux_nuv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_nuv.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- demux_nuv.c	22 Sep 2002 02:33:26 -0000	1.10
+++ demux_nuv.c	30 Sep 2002 21:10:41 -0000	1.11
@@ -140,8 +140,9 @@
 	struct rtframeheader rtjpeg_frameheader;
 	off_t orig_pos;
 	nuv_priv_t* priv = demuxer->priv;
+	int want_audio = (demuxer->audio)&&(demuxer->audio->id!=-2);
 
-	orig_pos = stream_tell ( demuxer->stream );
+	demuxer->filepos = orig_pos = stream_tell ( demuxer->stream );
 	if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
 	    return 0; /* EOF */
 
@@ -183,9 +184,18 @@
 	    (rtjpeg_frameheader.comptype == '0'))
 	{
 	    priv->current_audio_frame++;
-	    /* put Audio to audio buffer */
-	    ds_read_packet ( demuxer->audio, demuxer->stream, rtjpeg_frameheader.packetlength, 
-		rtjpeg_frameheader.timecode*0.001, orig_pos + 12, 0 );
+	    if (want_audio) {
+	      /* put Audio to audio buffer */
+	      ds_read_packet ( demuxer->audio, demuxer->stream,
+			       rtjpeg_frameheader.packetlength, 
+			       rtjpeg_frameheader.timecode*0.001,
+			       orig_pos + 12, 0 );
+	    } else {
+	      /* skip audio block */
+	      stream_seek ( demuxer->stream,
+			    stream_tell ( demuxer->stream )
+			    + rtjpeg_frameheader.packetlength );
+	    }
 	}
 
 	return 1;




More information about the MPlayer-cvslog mailing list