- 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@centrum.cz>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7567 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-09-30 21:10:41 +00:00
parent f7bfb1aaf6
commit 88ab61eaab
1 changed files with 14 additions and 4 deletions

View File

@ -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++;
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 );
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;