diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-07-25 00:23:27 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-07-25 01:10:30 +0300 |
commit | 8079f4ff821aa811de449f08dfdba777e8dd0397 (patch) | |
tree | 4f18f58d5e0fafc317e7d5541f5f291db7532d06 /libmpdemux/demux_asf.c | |
parent | 5f3c3f8c32d20405a2caf7de66aa1ea7f513d4d2 (diff) | |
download | mpv-8079f4ff821aa811de449f08dfdba777e8dd0397.tar.bz2 mpv-8079f4ff821aa811de449f08dfdba777e8dd0397.tar.xz |
demux, vd_ffmpeg: fix demux keyframe flag, set AV_PKT_FLAG_KEY
There was some confusion about the "flags" field in demuxer packets.
Demuxers set it to either 1 or 0x10 to indicate a keyframe (and the
field was not used to indicate anything else). This didn't cause
visible problems because nothing read the value. Replace the "flags"
field with a boolean "keyframe" field. Set AV_PKT_FLAG_KEY based on
this field in packets fed to libavcodec video decoders (looks like PNG
and ZeroCodec are the only ones which depend on values from demuxer;
previously this was hardcoded to true for PNG).
Make demux_mf set the keyframe field in every packet. This matters for
PNG files now that the demuxer flag is forwarded to libavcodec.
Fix logic setting the field in demux_mkv. It had probably not been
updated when adding SimpleBlock support. This probably makes no
difference for any current practical use.
Diffstat (limited to 'libmpdemux/demux_asf.c')
-rw-r--r-- | libmpdemux/demux_asf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c index eb71d4ef96..68ccab07d2 100644 --- a/libmpdemux/demux_asf.c +++ b/libmpdemux/demux_asf.c @@ -177,7 +177,7 @@ static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,in dp->pts=time*0.0000001; else dp->pts=time*0.001; - dp->flags=keyframe; + dp->keyframe = keyframe; // if(ds==demux->video) printf("ASF time: %8d dur: %5d \n",time,dur); dp->pos=demux->filepos; ds->asf_packet=dp; @@ -595,7 +595,8 @@ static void demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,float audio_de continue; } } - if(d_video->flags&1) break; // found a keyframe! + if (d_video->keyframe) + break; if(!ds_fill_buffer(d_video)) break; // skip frame. EOF? } |