From 8079f4ff821aa811de449f08dfdba777e8dd0397 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Wed, 25 Jul 2012 00:23:27 +0300 Subject: 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. --- stream/tv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/tv.c b/stream/tv.c index 64d7b4413e..07fb0270a6 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -233,7 +233,7 @@ static int demux_tv_fill_buffer(demuxer_t *demux, demux_stream_t *ds) len = tvh->functions->get_audio_framesize(tvh->priv); dp=new_demux_packet(len); - dp->flags|=1; /* Keyframe */ + dp->keyframe = true; dp->pts=tvh->functions->grab_audio_frame(tvh->priv, dp->buffer,len); ds_add_packet(demux->audio,dp); } @@ -245,7 +245,7 @@ static int demux_tv_fill_buffer(demuxer_t *demux, demux_stream_t *ds) { len = tvh->functions->get_video_framesize(tvh->priv); dp=new_demux_packet(len); - dp->flags|=1; /* Keyframe */ + dp->keyframe = true; dp->pts=tvh->functions->grab_video_frame(tvh->priv, dp->buffer, len); ds_add_packet(demux->video,dp); } -- cgit v1.2.3