Browse Source

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 802cca5905)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
tags/n2.4.12
Michael Niedermayer Andreas Cadhalpun 10 years ago
parent
commit
46a7fe2417
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/s302m.c

+ 2
- 1
libavcodec/s302m.c View File

@@ -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;


Loading…
Cancel
Save