summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-05-03 14:15:14 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-05-03 14:15:14 +0200
commitfd0f1442eb78e2520fcfc7b13250ddf1ead2bc9d (patch)
treedff529a597dd708fd79ecb6e78a7a7633b72a223 /libavformat/mpegtsenc.c
parenta454ad670c770902f739012ff9ed4178bd9e6feb (diff)
lavf/mpegtsenc: Fix stream_type for low sample rate MP2/MP3.
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index f4cb862bb9..d8927b7a8a 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -318,7 +318,12 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
break;
case AV_CODEC_ID_MP2:
case AV_CODEC_ID_MP3:
- stream_type = STREAM_TYPE_AUDIO_MPEG1;
+ if ( st->codec->sample_rate > 0
+ && st->codec->sample_rate < 32000) {
+ stream_type = STREAM_TYPE_AUDIO_MPEG2;
+ } else {
+ stream_type = STREAM_TYPE_AUDIO_MPEG1;
+ }
break;
case AV_CODEC_ID_AAC:
stream_type = (ts->flags & MPEGTS_FLAG_AAC_LATM)