lavf: factor codec id forcing out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit a7fbc7d7b7eabc74ceb1970a995c56043315e433) Conflicts: libavformat/utils.c
This commit is contained in:
parent
8bc0127b3d
commit
5502b073ec
@ -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 ff_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
@ -721,17 +736,7 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
|
|
||||||
st= s->streams[pkt->stream_index];
|
st= s->streams[pkt->stream_index];
|
||||||
|
|
||||||
switch(st->codec->codec_type){
|
force_codec_ids(s, st);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!pktl && st->request_probe <= 0)
|
if(!pktl && st->request_probe <= 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user