[FFmpeg-cvslog] avcodec/s302m: Only set the sample rate when some data is output

Michael Niedermayer git at videolan.org
Thu Nov 26 01:46:57 CET 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Sat Jun  6 00:59:16 2015 +0200| [8aeff8a0137042457b997094d4fe2930973c8cbf] | committer: Andreas Cadhalpun

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 at gmx.at>
(cherry picked from commit 802cca5905abe1fe8392e85a812462b959889aaa)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8aeff8a0137042457b997094d4fe2930973c8cbf
---

 libavcodec/s302m.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index 7639a0f..2ce1038 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;



More information about the ffmpeg-cvslog mailing list