Browse Source

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

tags/n3.1
Carl Eugen Hoyos 9 years ago
parent
commit
fd0f1442eb
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavformat/mpegtsenc.c

+ 6
- 1
libavformat/mpegtsenc.c 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)


Loading…
Cancel
Save