diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-06 00:59:16 +0200 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-11-26 01:37:55 +0100 |
commit | 761bd6df06ec03aa32872712583852b20133d8ba (patch) | |
tree | 393d3108dd5e3cd9fd3b36836716aac594e7954c | |
parent | 1548223d29c939366d20923732b594f41d167253 (diff) | |
download | ffmpeg-761bd6df06ec03aa32872712583852b20133d8ba.tar.gz |
avcodec/s302m: Only set the sample rate when some data is output
This way ffplay chooses the mp2 stream for Ticket3890
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 802cca5905abe1fe8392e85a812462b959889aaa)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavcodec/s302m.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 7639a0f1c9..2ce1038330 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -79,7 +79,6 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, case 8: avctx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX; } - avctx->sample_rate = 48000; avctx->bit_rate = 48000 * avctx->channels * (avctx->bits_per_raw_sample + 4) + 32 * (48000 / (buf_size * 8 / (avctx->channels * @@ -146,6 +145,8 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data, } } + avctx->sample_rate = 48000; + *got_frame_ptr = 1; return avpkt->size; |