mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
rmdec: set bit rate for ra3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8e09e183fc
commit
76f126ba2e
@ -127,9 +127,12 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
|
|||||||
/* ra type header */
|
/* ra type header */
|
||||||
version = avio_rb16(pb); /* version */
|
version = avio_rb16(pb); /* version */
|
||||||
if (version == 3) {
|
if (version == 3) {
|
||||||
|
unsigned bytes_per_minute;
|
||||||
int header_size = avio_rb16(pb);
|
int header_size = avio_rb16(pb);
|
||||||
int64_t startpos = avio_tell(pb);
|
int64_t startpos = avio_tell(pb);
|
||||||
avio_skip(pb, 14);
|
avio_skip(pb, 8);
|
||||||
|
bytes_per_minute = avio_rb16(pb);
|
||||||
|
avio_skip(pb, 4);
|
||||||
rm_read_metadata(s, 0);
|
rm_read_metadata(s, 0);
|
||||||
if ((startpos + header_size) >= avio_tell(pb) + 2) {
|
if ((startpos + header_size) >= avio_tell(pb) + 2) {
|
||||||
// fourcc (should always be "lpcJ")
|
// fourcc (should always be "lpcJ")
|
||||||
@ -139,6 +142,8 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
|
|||||||
// Skip extra header crap (this should never happen)
|
// Skip extra header crap (this should never happen)
|
||||||
if ((startpos + header_size) > avio_tell(pb))
|
if ((startpos + header_size) > avio_tell(pb))
|
||||||
avio_skip(pb, header_size + startpos - avio_tell(pb));
|
avio_skip(pb, header_size + startpos - avio_tell(pb));
|
||||||
|
if (bytes_per_minute)
|
||||||
|
st->codec->bit_rate = 8LL * bytes_per_minute / 60;
|
||||||
st->codec->sample_rate = 8000;
|
st->codec->sample_rate = 8000;
|
||||||
st->codec->channels = 1;
|
st->codec->channels = 1;
|
||||||
st->codec->channel_layout = AV_CH_LAYOUT_MONO;
|
st->codec->channel_layout = AV_CH_LAYOUT_MONO;
|
||||||
|
Loading…
Reference in New Issue
Block a user