diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-28 14:48:42 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-28 14:48:42 +0000 |
commit | 0b339acb9e436c01cc1d3c36dbb21619fca2d034 (patch) | |
tree | 780920137d6ab8e76c5e5b42e48b99b5dc8afeb9 /libavformat/asf.c | |
parent | 4d38ebfd7b2ff9d501526b780b3a38351db838d8 (diff) | |
download | ffmpeg-streaming-0b339acb9e436c01cc1d3c36dbb21619fca2d034.zip ffmpeg-streaming-0b339acb9e436c01cc1d3c36dbb21619fca2d034.tar.gz |
revert r8538 (set bit rate for asf format) until regression tests issue is stated
Originally committed as revision 8539 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf.c')
-rw-r--r-- | libavformat/asf.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c index 3cc869d..a9531ef 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -148,10 +148,8 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) int size, i; int64_t gsize; AVRational dar[128]; - uint32_t bitrate[128]; memset(dar, 0, sizeof(dar)); - memset(bitrate, 0, sizeof(bitrate)); get_guid(pb, &g); if (memcmp(&g, &asf_header, sizeof(GUID))) @@ -419,13 +417,13 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) } } else if (!memcmp(&g, &ext_stream_header, sizeof(GUID))) { int ext_len, payload_ext_ct, stream_ct; - uint32_t ext_d, leak_rate, stream_num; + uint32_t ext_d; int64_t pos_ex_st; pos_ex_st = url_ftell(pb); get_le64(pb); // starttime get_le64(pb); // endtime - leak_rate = get_le32(pb); // leak-datarate + get_le32(pb); // leak-datarate get_le32(pb); // bucket-datasize get_le32(pb); // init-bucket-fullness get_le32(pb); // alt-leak-datarate @@ -433,15 +431,12 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) get_le32(pb); // alt-init-bucket-fullness get_le32(pb); // max-object-size get_le32(pb); // flags (reliable,seekable,no_cleanpoints?,resend-live-cleanpoints, rest of bits reserved) - stream_num = get_le16(pb); // stream-num + get_le16(pb); // stream-num get_le16(pb); // stream-language-id-index get_le64(pb); // avg frametime in 100ns units stream_ct = get_le16(pb); //stream-name-count payload_ext_ct = get_le16(pb); //payload-extension-system-count - if (stream_num < 128) - bitrate[stream_num] = leak_rate; - for (i=0; i<stream_ct; i++){ get_le16(pb); ext_len = get_le16(pb); @@ -505,13 +500,11 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) for(i=0; i<128; i++){ int stream_num= asf->asfid2avid[i]; - if(stream_num>=0){ + if(stream_num>=0 && dar[i].num>0 && dar[i].den>0){ AVCodecContext *codec= s->streams[stream_num]->codec; - codec->bit_rate = bitrate[i]; - if (dar[i].num > 0 && dar[i].den > 0) - av_reduce(&codec->sample_aspect_ratio.num, - &codec->sample_aspect_ratio.den, - dar[i].num, dar[i].den, INT_MAX); + av_reduce(&codec->sample_aspect_ratio.num, + &codec->sample_aspect_ratio.den, + dar[i].num, dar[i].den, INT_MAX); //av_log(NULL, AV_LOG_ERROR, "dar %d:%d sar=%d:%d\n", dar[i].num, dar[i].den, codec->sample_aspect_ratio.num, codec->sample_aspect_ratio.den); } } |