[MPlayer-dev-eng] [PATCH] NuppelVideo 3-pass encoding with mencoder

Petr Pudlak wandermind at centrum.cz
Mon Sep 30 21:35:23 CEST 2002


	Hello,

this litle patch fixes two following bugs/problems:

(1) PROBLEM: When using 'frameno.avi' (3-pass encoding process) with
NuppelVideo files, the demuxer reads audio packets, but noone uses
them, thus after ~47sec the buffer gets full and encoding is aborted.
(perhaps other file formats may also have this problem)

SOLUTION: demuxer->audio->id is set to -2 when using 'frameno.avi', so
in that case, just skip audio packets.

(2) PROBLEM: When processing NuppelVideo files with mencoder,
remaining time, estimated size, etc. fields are not computed.

SOLUTION: Update demuxer->filepos variable when reading the packets.


	Everybody have a nice day,

		Petr Pudlak


--- MPlayer-20020914/libmpdemux/demux_nuv.c	Tue Sep 10 22:42:45 2002
+++ MPlayer-20020914-patch/libmpdemux/demux_nuv.c	Sun Sep 15 18:35:05 2002
@@ -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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020930/66cdc3d7/attachment.pgp>


More information about the MPlayer-dev-eng mailing list