]> git.sesse.net Git - mlt/blobdiff - src/modules/avformat/consumer_avformat.c
fix samples number calculation for 24 and 32 bit output
[mlt] / src / modules / avformat / consumer_avformat.c
index 8776de886f43e90288b7725cf082865f1456a6fa..b4753fa94c7b74c539c7f9ed4539472352264501 100644 (file)
@@ -709,6 +709,20 @@ static int open_audio( mlt_properties properties, AVFormatContext *oc, AVStream
                                case AV_CODEC_ID_PCM_U16BE:
                                        audio_input_frame_size >>= 1;
                                        break;
+#if LIBAVCODEC_VERSION_INT >= ((54<<16)+(59<<8)+0)
+                               case AV_CODEC_ID_PCM_S24LE:
+                               case AV_CODEC_ID_PCM_S24BE:
+                               case AV_CODEC_ID_PCM_U24LE:
+                               case AV_CODEC_ID_PCM_U24BE:
+                                       audio_input_frame_size /= 3;
+                                       break;
+                               case AV_CODEC_ID_PCM_S32LE:
+                               case AV_CODEC_ID_PCM_S32BE:
+                               case AV_CODEC_ID_PCM_U32LE:
+                               case AV_CODEC_ID_PCM_U32BE:
+                                       audio_input_frame_size >>= 2;
+                                       break;
+#endif
                                default:
                                        break;
                        }