Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
lavf/mpegtsenc: Fix stream_type for low sample rate MP2/MP3.
  • Loading branch information
cehoyos committed May 3, 2016
1 parent a454ad6 commit fd0f144
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libavformat/mpegtsenc.c
Expand Up @@ -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)
Expand Down

0 comments on commit fd0f144

Please sign in to comment.