diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-30 00:56:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-30 00:56:33 +0200 |
commit | 7d1918affee4bc70fb8ac139ba9235e7fed2979b (patch) | |
tree | b8c1beadf98aceeee6a155ae83bfc110656ca595 /libavformat/flvdec.c | |
parent | 316f6df9cc5a70c5b117793c9f167c4ce629c1e0 (diff) | |
parent | 41f43202cf7648522b4ce0ed7bbb326655dbb9bc (diff) | |
download | ffmpeg-7d1918affee4bc70fb8ac139ba9235e7fed2979b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
flvdec: remove spurious use of stream id
lavf: deprecate r_frame_rate.
lavf: round estimated average fps to a "standard" fps.
Conflicts:
ffmpeg.c
ffprobe.c
libavformat/avformat.h
libavformat/electronicarts.c
libavformat/flvdec.c
libavformat/rawdec.c
libavformat/utils.c
tests/ref/fate/iv8-demux
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r-- | libavformat/flvdec.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 997824dcec..f8c25d36c1 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -65,11 +65,11 @@ static int flv_probe(AVProbeData *p) return 0; } -static AVStream *create_stream(AVFormatContext *s, int tag, int codec_type){ +static AVStream *create_stream(AVFormatContext *s, int codec_type) +{ AVStream *st = avformat_new_stream(s, NULL); if (!st) return NULL; - st->id = tag; st->codec->codec_type = codec_type; if(s->nb_streams>=3 ||( s->nb_streams==2 && s->streams[0]->codec->codec_type != AVMEDIA_TYPE_DATA @@ -402,7 +402,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst else if (!strcmp(key, "audiodatarate") && acodec && 0 <= (int)(num_val * 1024.0)) acodec->bit_rate = num_val * 1024.0; else if (!strcmp(key, "datastream")) { - AVStream *st = create_stream(s, 2, AVMEDIA_TYPE_DATA); + AVStream *st = create_stream(s, AVMEDIA_TYPE_DATA); if (!st) return AVERROR(ENOMEM); st->codec->codec_id = CODEC_ID_TEXT; @@ -509,11 +509,11 @@ static int flv_read_header(AVFormatContext *s) s->ctx_flags |= AVFMTCTX_NOHEADER; if(flags & FLV_HEADER_FLAG_HASVIDEO){ - if(!create_stream(s, 0, AVMEDIA_TYPE_VIDEO)) + if(!create_stream(s, AVMEDIA_TYPE_VIDEO)) return AVERROR(ENOMEM); } if(flags & FLV_HEADER_FLAG_HASAUDIO){ - if(!create_stream(s, 1, AVMEDIA_TYPE_AUDIO)) + if(!create_stream(s, AVMEDIA_TYPE_AUDIO)) return AVERROR(ENOMEM); } // Flag doesn't indicate whether or not there is script-data present. Must @@ -617,7 +617,7 @@ static int flv_data_packet(AVFormatContext *s, AVPacket *pkt, } if (i == s->nb_streams) { - st = create_stream(s, 2, AVMEDIA_TYPE_DATA); + st = create_stream(s, AVMEDIA_TYPE_DATA); if (!st) goto out; st->codec->codec_id = CODEC_ID_TEXT; @@ -727,7 +727,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) } if(i == s->nb_streams){ av_log(s, AV_LOG_WARNING, "Stream discovered after head already parsed\n"); - st = create_stream(s, stream_type, + st = create_stream(s, (int[]){AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_DATA}[stream_type]); } av_dlog(s, "%d %X %d \n", stream_type, flags, st->discard); |