mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
Dont modify wanted_stream.
Originally committed as revision 22007 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
5b369983c6
commit
256ab3ed9d
15
ffplay.c
15
ffplay.c
@ -1980,6 +1980,7 @@ static int decode_thread(void *arg)
|
|||||||
AVFormatContext *ic;
|
AVFormatContext *ic;
|
||||||
int err, i, ret;
|
int err, i, ret;
|
||||||
int st_index[CODEC_TYPE_NB];
|
int st_index[CODEC_TYPE_NB];
|
||||||
|
int st_count[CODEC_TYPE_NB]={0};
|
||||||
AVPacket pkt1, *pkt = &pkt1;
|
AVPacket pkt1, *pkt = &pkt1;
|
||||||
AVFormatParameters params, *ap = ¶ms;
|
AVFormatParameters params, *ap = ¶ms;
|
||||||
int eof=0;
|
int eof=0;
|
||||||
@ -2045,18 +2046,20 @@ static int decode_thread(void *arg)
|
|||||||
for(i = 0; i < ic->nb_streams; i++) {
|
for(i = 0; i < ic->nb_streams; i++) {
|
||||||
AVCodecContext *avctx = ic->streams[i]->codec;
|
AVCodecContext *avctx = ic->streams[i]->codec;
|
||||||
ic->streams[i]->discard = AVDISCARD_ALL;
|
ic->streams[i]->discard = AVDISCARD_ALL;
|
||||||
|
if(avctx->codec_type >= (unsigned)CODEC_TYPE_NB)
|
||||||
|
exit(1);
|
||||||
|
if(st_count[avctx->codec_type]++ != wanted_stream[avctx->codec_type] && wanted_stream[avctx->codec_type] >= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
switch(avctx->codec_type) {
|
switch(avctx->codec_type) {
|
||||||
case CODEC_TYPE_AUDIO:
|
case CODEC_TYPE_AUDIO:
|
||||||
if (wanted_stream[CODEC_TYPE_AUDIO]-- >= 0 && !audio_disable)
|
if (!audio_disable)
|
||||||
st_index[CODEC_TYPE_AUDIO] = i;
|
st_index[CODEC_TYPE_AUDIO] = i;
|
||||||
break;
|
break;
|
||||||
case CODEC_TYPE_VIDEO:
|
case CODEC_TYPE_VIDEO:
|
||||||
if (wanted_stream[CODEC_TYPE_VIDEO]-- >= 0 && !video_disable)
|
|
||||||
st_index[CODEC_TYPE_VIDEO] = i;
|
|
||||||
break;
|
|
||||||
case CODEC_TYPE_SUBTITLE:
|
case CODEC_TYPE_SUBTITLE:
|
||||||
if (wanted_stream[CODEC_TYPE_SUBTITLE]-- >= 0 && !video_disable)
|
if (!video_disable)
|
||||||
st_index[CODEC_TYPE_SUBTITLE] = i;
|
st_index[avctx->codec_type] = i;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user