summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-07-28 13:27:57 +0000
committerMichael Niedermayer <michaelni@gmx.at>2014-08-14 03:12:58 +0200
commitd92550d19129f230d534c832c5a41591682ebbf8 (patch)
tree919756b43062a51d5e861e35e846c8e5e2f18046 /libavformat/mux.c
parent7b59217b60cc7133766ea33ee8519efda9ec4c5c (diff)
lavf: eliminate ff_get_audio_frame_size()
It is basically a wrapper around av_get_audio_frame_duration(), with a fallback to AVCodecContext.frame_size. However, that field is set only when the stream codec context is actually used for encoding or decoding, which is discouraged. For muxing, it is generally the responsibility of the caller to set the packet duration. For demuxing, if the duration is not stored at the container level, it should be set by the parser. Therefore, removing the frame_size fallback should not break any important case. (cherry picked from commit 30e50c50274f88f0f5ae829f401cd3c7f5266719) Conflicts: libavformat/utils.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index dbb9b55f39..55add43ebb 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -521,7 +521,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
case AVMEDIA_TYPE_AUDIO:
frame_size = (pkt->flags & AV_PKT_FLAG_UNCODED_FRAME) ?
((AVFrame *)pkt->data)->nb_samples :
- ff_get_audio_frame_size(st->codec, pkt->size, 1);
+ av_get_audio_frame_duration(st->codec, pkt->size);
/* HACK/FIXME, we skip the initial 0 size packets as they are most
* likely equal to the encoder delay, but it would be better if we