From 88ab61eaab8b93490adf214ad3d8bf37c32add58 Mon Sep 17 00:00:00 2001 From: arpi Date: Mon, 30 Sep 2002 21:10:41 +0000 Subject: [PATCH] - 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 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7567 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_nuv.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/libmpdemux/demux_nuv.c b/libmpdemux/demux_nuv.c index b488d462d6..eb12313494 100644 --- a/libmpdemux/demux_nuv.c +++ b/libmpdemux/demux_nuv.c @@ -140,8 +140,9 @@ int demux_nuv_fill_buffer ( demuxer_t *demuxer ) 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 @@ int demux_nuv_fill_buffer ( demuxer_t *demuxer ) (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;