avformat/flvenc: fix stereo flag when writing PCMA/PCMU

Currently, when writing PCMA or PCMU tracks with FLV or RTMP, the
stereo flag and sample rate flag inside RTMP audio messages are
overridden, making impossible to distinguish between mono and stereo
tracks. This patch fixes the issue by restoring the same flag mechanism
of all other codecs, that takes into consideration the right channel
count and sample rate.

Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Alessandro Ros 2024-01-21 16:16:20 +01:00 committed by Marton Balint
parent fa580a0f17
commit 49ab7f8997
1 changed files with 2 additions and 2 deletions

View File

@ -208,10 +208,10 @@ error:
flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT; flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT;
break; break;
case AV_CODEC_ID_PCM_MULAW: case AV_CODEC_ID_PCM_MULAW:
flags = FLV_CODECID_PCM_MULAW | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT; flags |= FLV_CODECID_PCM_MULAW | FLV_SAMPLESSIZE_16BIT;
break; break;
case AV_CODEC_ID_PCM_ALAW: case AV_CODEC_ID_PCM_ALAW:
flags = FLV_CODECID_PCM_ALAW | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT; flags |= FLV_CODECID_PCM_ALAW | FLV_SAMPLESSIZE_16BIT;
break; break;
case 0: case 0:
flags |= par->codec_tag << 4; flags |= par->codec_tag << 4;