On Fri, Jan 01, 2016 at 07:33:58PM +0100, Hendrik Leppkes wrote: > On Fri, Jan 1, 2016 at 7:29 PM, Ronald S. Bultje <rsbul...@gmail.com> wrote: > > Hi, > > > > On Fri, Jan 1, 2016 at 11:43 AM, Michael Niedermayer <michae...@gmx.at> > > wrote: > > > >> From: Michael Niedermayer <mich...@niedermayer.cc> > >> > >> This is not guranteed to be correct but only the encoder or the packet > >> headers > >> can really provide the correct value. And before the first packet there is > >> no alternative to receiving the value from the encoder by some means > >> > >> other codecs like AAC are still missing and are left for voluteers > >> > >> Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > >> --- > >> libavcodec/utils.c | 6 ++++++ > >> 1 file changed, 6 insertions(+) > >> > >> diff --git a/libavcodec/utils.c b/libavcodec/utils.c > >> index 4b4aea0..6ed47ef 100644 > >> --- a/libavcodec/utils.c > >> +++ b/libavcodec/utils.c > >> @@ -3042,6 +3042,12 @@ int av_get_audio_frame_duration(AVCodecContext > >> *avctx, int frame_bytes) > >> if (id == AV_CODEC_ID_TTA) > >> return 256 * sr / 245; > >> > >> + // When frame_bytes is set then the headers can be parsed to find > >> the > >> + // frame size > >> + if (id == AV_CODEC_ID_MP3 && !frame_bytes) { > >> + return sr <= 24000 ? 576 : 1152; > >> + } > >> + > >> if (ch > 0) { > >> /* calc from sample rate and channels */ > >> if (id == AV_CODEC_ID_BINKAUDIO_DCT) > >> -- > >> 1.7.9.5 > > > > > > Please, no more codec-specific hacks in generic code. > > > > This whole function is codec specific crazy.
yes, i surely would not mind if someone would split&move this function into codecs or parsers or a callback in codec descriptors AVCodecs is semantically wrong though as this is not specific to a codec implementation [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No human being will ever know the Truth, for even if they happen to say it by chance, they would not even known they had done so. -- Xenophanes
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel