[FFmpeg-cvslog] lavf: factor codec id forcing out
Michael Niedermayer
git at videolan.org
Wed Jan 2 02:43:24 CET 2013
ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Fri Sep 7 13:16:04 2012 +0200| [5502b073ec2996b61275aa1ea1c8f3ac24a3d88e] | committer: Carl Eugen Hoyos
lavf: factor codec id forcing out
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit a7fbc7d7b7eabc74ceb1970a995c56043315e433)
Conflicts:
libavformat/utils.c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5502b073ec2996b61275aa1ea1c8f3ac24a3d88e
---
libavformat/utils.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index fd0b10b..1e0b344 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -673,6 +673,21 @@ fail:
/*******************************************************/
+static void force_codec_ids(AVFormatContext *s, AVStream *st)
+{
+ switch(st->codec->codec_type){
+ case AVMEDIA_TYPE_VIDEO:
+ if(s->video_codec_id) st->codec->codec_id= s->video_codec_id;
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ if(s->audio_codec_id) st->codec->codec_id= s->audio_codec_id;
+ break;
+ case AVMEDIA_TYPE_SUBTITLE:
+ if(s->subtitle_codec_id)st->codec->codec_id= s->subtitle_codec_id;
+ break;
+ }
+}
+
int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, i;
@@ -721,17 +736,7 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
st= s->streams[pkt->stream_index];
- switch(st->codec->codec_type){
- case AVMEDIA_TYPE_VIDEO:
- if(s->video_codec_id) st->codec->codec_id= s->video_codec_id;
- break;
- case AVMEDIA_TYPE_AUDIO:
- if(s->audio_codec_id) st->codec->codec_id= s->audio_codec_id;
- break;
- case AVMEDIA_TYPE_SUBTITLE:
- if(s->subtitle_codec_id)st->codec->codec_id= s->subtitle_codec_id;
- break;
- }
+ force_codec_ids(s, st);
if(!pktl && st->request_probe <= 0)
return ret;
More information about the ffmpeg-cvslog
mailing list