1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

lavf/mpegtsenc: Fix stream_type for low sample rate MP2/MP3.

This commit is contained in:
Carl Eugen Hoyos 2016-05-03 14:15:14 +02:00
parent a454ad670c
commit fd0f1442eb

View File

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