History

lavc: use a separate field for exporting audio encoder padding

Currently, the amount of padding inserted at the beginning by some audio encoders, is exported through AVCodecContext.delay. However - the term 'delay' is heavily overloaded and can have multiple different meanings even in the case of audio encoding. - this field has entirely different meanings, depending on whether the codec context is used for encoding or decoding (and has yet another different meaning for video), preventing generic handling of the codec context. Therefore, add a new field -- AVCodecContext.initial_padding. It could conceivably be used for decoding as well at a later point.

Anton Khirnov committed 12 years ago

Commit 2df0c321 parent c80a81622 files · +63 −40Browse files

Unified · Split

22 files
  1. doc/APIchanges +4 −0
  2. libavcodec/aacenc.c +1 −1
  3. libavcodec/ac3enc.c +1 −1
  4. libavcodec/audio_frame_queue.c +2 −2
  5. libavcodec/avcodec.h +18 −10
  6. libavcodec/g722enc.c +2 −2
  7. libavcodec/libfaac.c +1 −1
  8. libavcodec/libfdk-aacenc.c +1 −1
  9. libavcodec/libmp3lame.c +1 −1
  10. libavcodec/libopencore-amr.c +2 −2
  11. libavcodec/libopusenc.c +2 −2
  12. libavcodec/libspeexenc.c +1 −1
  13. libavcodec/libtwolame.c +2 −2
  14. libavcodec/libvo-aacenc.c +1 −1
  15. libavcodec/libvo-amrwbenc.c +2 −2
  16. libavcodec/libvorbis.c +2 −2
  17. libavcodec/mpegaudioenc.c +2 −2
  18. libavcodec/nellymoserenc.c +1 −1
  19. libavcodec/ra144enc.c +1 −1
  20. libavcodec/utils.c +9 −0
  21. libavcodec/version.h +5 −2
  22. libavcodec/wmaenc.c +2 −3
doc/APIchanges+4−0
@@ -13,6 +13,10 @@ libavutil: 2014-08-09 · 12 unmodified lines
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162014-10-13 - xxxxxxx - lavc 55.03.0 - avcodec.h
17 Add AVCodecContext.initial_padding. Deprecate the use of AVCodecContext.delay
18 for audio encoding.
19
162014-09-xx - xxxxxxx - lavu 54.04.0 - pixdesc.h202014-09-xx - xxxxxxx - lavu 54.04.0 - pixdesc.h
17 Add API to return the name of frame and context color properties.21 Add API to return the name of frame and context color properties.
18 22
libavcodec/aacenc.c+1−1
@@ -777,7 +777,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 776 unmodified lines
777 for (i = 0; i < 428; i++)777 for (i = 0; i < 428; i++)
778 ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));778 ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));
779 779
780 avctx->delay = 1024;780 avctx->initial_padding = 1024;
781 ff_af_queue_init(avctx, &s->afq);781 ff_af_queue_init(avctx, &s->afq);
782 782
783 return 0;783 return 0;
libavcodec/ac3enc.c+1−1
@@ -2436,7 +2436,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx) · 2435 unmodified lines
2436 return ret;2436 return ret;
2437 2437
2438 avctx->frame_size = AC3_BLOCK_SIZE * s->num_blocks;2438 avctx->frame_size = AC3_BLOCK_SIZE * s->num_blocks;
2439 avctx->delay = AC3_BLOCK_SIZE;2439 avctx->initial_padding = AC3_BLOCK_SIZE;
2440 2440
2441 s->bitstream_mode = avctx->audio_service_type;2441 s->bitstream_mode = avctx->audio_service_type;
2442 if (s->bitstream_mode == AV_AUDIO_SERVICE_TYPE_KARAOKE)2442 if (s->bitstream_mode == AV_AUDIO_SERVICE_TYPE_KARAOKE)
libavcodec/audio_frame_queue.c+2−2
@@ -29,8 +29,8 @@ av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq) · 28 unmodified lines
29{29{
30 afq->avctx = avctx;30 afq->avctx = avctx;
31 afq->next_pts = AV_NOPTS_VALUE;31 afq->next_pts = AV_NOPTS_VALUE;
32 afq->remaining_delay = avctx->delay;32 afq->remaining_delay = avctx->initial_padding;
33 afq->remaining_samples = avctx->delay;33 afq->remaining_samples = avctx->initial_padding;
34 afq->frame_queue = NULL;34 afq->frame_queue = NULL;
35}35}
36 36
libavcodec/avcodec.h+18−10
@@ -1191,16 +1191,7 @@ typedef struct AVCodecContext { · 1190 unmodified lines
1191 * encoded input.1191 * encoded input.
1192 *1192 *
1193 * Audio:1193 * Audio:
1194 * For encoding, this is the number of "priming" samples added by the1194 * For encoding, this field is unused (see initial_padding).
1195 * encoder to the beginning of the stream. The decoded output will be
1196 * delayed by this many samples relative to the input to the encoder (or
1197 * more, if the decoder adds its own padding).
1198 * The timestamps on the output packets are adjusted by the encoder so
1199 * that they always refer to the first sample of the data actually
1200 * contained in the packet, including any added padding.
1201 * E.g. if the timebase is 1/samplerate and the timestamp of the first
1202 * input sample is 0, the timestamp of the first output packet will be
1203 * -delay.
1204 *1195 *
1205 * For decoding, this is the number of samples the decoder needs to1196 * For decoding, this is the number of samples the decoder needs to
1206 * output before the decoder's output is valid. When seeking, you should1197 * output before the decoder's output is valid. When seeking, you should
@@ -2780,6 +2771,23 @@ typedef struct AVCodecContext { · 1573 unmodified lines
2780 * use AVOptions to set this field.2771 * use AVOptions to set this field.
2781 */2772 */
2782 int side_data_only_packets;2773 int side_data_only_packets;
2774
2775 /**
2776 * Audio only. The number of "priming" samples (padding) inserted by the
2777 * encoder at the beginning of the audio. I.e. this number of leading
2778 * decoded samples must be discarded by the caller to get the original audio
2779 * without leading padding.
2780 *
2781 * - decoding: unused
2782 * - encoding: Set by libavcodec. The timestamps on the output packets are
2783 * adjusted by the encoder so that they always refer to the
2784 * first sample of the data actually contained in the packet,
2785 * including any added padding. E.g. if the timebase is
2786 * 1/samplerate and the timestamp of the first input sample is
2787 * 0, the timestamp of the first output packet will be
2788 * -initial_padding.
2789 */
2790 int initial_padding;
2783} AVCodecContext;2791} AVCodecContext;
2784 2792
2785/**2793/**
libavcodec/g722enc.c+2−2
@@ -106,7 +106,7 @@ static av_cold int g722_encode_init(AVCodecContext * avctx) · 105 unmodified lines
106 a common packet size for VoIP applications */106 a common packet size for VoIP applications */
107 avctx->frame_size = 320;107 avctx->frame_size = 320;
108 }108 }
109 avctx->delay = 22;109 avctx->initial_padding = 22;
110 110
111 if (avctx->trellis) {111 if (avctx->trellis) {
112 /* validate trellis */112 /* validate trellis */
@@ -375,7 +375,7 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 262 unmodified lines
375 }375 }
376 376
377 if (frame->pts != AV_NOPTS_VALUE)377 if (frame->pts != AV_NOPTS_VALUE)
378 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);378 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
379 *got_packet_ptr = 1;379 *got_packet_ptr = 1;
380 return 0;380 return 0;
381}381}
libavcodec/libfaac.c+1−1
@@ -157,7 +157,7 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx) · 156 unmodified lines
157 goto error;157 goto error;
158 }158 }
159 159
160 avctx->delay = FAAC_DELAY_SAMPLES;160 avctx->initial_padding = FAAC_DELAY_SAMPLES;
161 ff_af_queue_init(avctx, &s->afq);161 ff_af_queue_init(avctx, &s->afq);
162 162
163 return 0;163 return 0;
libavcodec/libfdk-aacenc.c+1−1
@@ -286,7 +286,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 285 unmodified lines
286 }286 }
287 287
288 avctx->frame_size = info.frameLength;288 avctx->frame_size = info.frameLength;
289 avctx->delay = info.encoderDelay;289 avctx->initial_padding = info.encoderDelay;
290 ff_af_queue_init(avctx, &s->afq);290 ff_af_queue_init(avctx, &s->afq);
291 291
292 if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {292 if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
libavcodec/libmp3lame.c+1−1
@@ -137,7 +137,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx) · 136 unmodified lines
137 }137 }
138 138
139 /* get encoder delay */139 /* get encoder delay */
140 avctx->delay = lame_get_encoder_delay(s->gfp) + 528 + 1;140 avctx->initial_padding = lame_get_encoder_delay(s->gfp) + 528 + 1;
141 ff_af_queue_init(avctx, &s->afq);141 ff_af_queue_init(avctx, &s->afq);
142 142
143 avctx->frame_size = lame_get_framesize(s->gfp);143 avctx->frame_size = lame_get_framesize(s->gfp);
libavcodec/libopencore-amr.c+2−2
@@ -200,7 +200,7 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx) · 199 unmodified lines
200 }200 }
201 201
202 avctx->frame_size = 160;202 avctx->frame_size = 160;
203 avctx->delay = 50;203 avctx->initial_padding = 50;
204 ff_af_queue_init(avctx, &s->afq);204 ff_af_queue_init(avctx, &s->afq);
205 205
206 s->enc_state = Encoder_Interface_init(s->enc_dtx);206 s->enc_state = Encoder_Interface_init(s->enc_dtx);
@@ -250,7 +250,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 43 unmodified lines
250 return AVERROR(ENOMEM);250 return AVERROR(ENOMEM);
251 memcpy(flush_buf, samples, frame->nb_samples * sizeof(*flush_buf));251 memcpy(flush_buf, samples, frame->nb_samples * sizeof(*flush_buf));
252 samples = flush_buf;252 samples = flush_buf;
253 if (frame->nb_samples < avctx->frame_size - avctx->delay)253 if (frame->nb_samples < avctx->frame_size - avctx->initial_padding)
254 s->enc_last_frame = -1;254 s->enc_last_frame = -1;
255 }255 }
256 if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) {256 if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) {
libavcodec/libopusenc.c+2−2
@@ -87,7 +87,7 @@ static void libopus_write_header(AVCodecContext *avctx, int stream_count, · 86 unmodified lines
87 bytestream_put_buffer(&p, "OpusHead", 8);87 bytestream_put_buffer(&p, "OpusHead", 8);
88 bytestream_put_byte(&p, 1); /* Version */88 bytestream_put_byte(&p, 1); /* Version */
89 bytestream_put_byte(&p, channels);89 bytestream_put_byte(&p, channels);
90 bytestream_put_le16(&p, avctx->delay); /* Lookahead samples at 48kHz */90 bytestream_put_le16(&p, avctx->initial_padding); /* Lookahead samples at 48kHz */
91 bytestream_put_le32(&p, avctx->sample_rate); /* Original sample rate */91 bytestream_put_le32(&p, avctx->sample_rate); /* Original sample rate */
92 bytestream_put_le16(&p, 0); /* Gain of 0dB is recommended. */92 bytestream_put_le16(&p, 0); /* Gain of 0dB is recommended. */
93 93
@@ -277,7 +277,7 @@ static int av_cold libopus_encode_init(AVCodecContext *avctx) · 183 unmodified lines
277 goto fail;277 goto fail;
278 }278 }
279 279
280 ret = opus_multistream_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&avctx->delay));280 ret = opus_multistream_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&avctx->initial_padding));
281 if (ret != OPUS_OK)281 if (ret != OPUS_OK)
282 av_log(avctx, AV_LOG_WARNING,282 av_log(avctx, AV_LOG_WARNING,
283 "Unable to get number of lookahead samples: %s\n",283 "Unable to get number of lookahead samples: %s\n",
libavcodec/libspeexenc.c+1−1
@@ -235,7 +235,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 234 unmodified lines
235 s->header.frames_per_packet = s->frames_per_packet;235 s->header.frames_per_packet = s->frames_per_packet;
236 236
237 /* set encoding delay */237 /* set encoding delay */
238 speex_encoder_ctl(s->enc_state, SPEEX_GET_LOOKAHEAD, &avctx->delay);238 speex_encoder_ctl(s->enc_state, SPEEX_GET_LOOKAHEAD, &avctx->initial_padding);
239 ff_af_queue_init(avctx, &s->afq);239 ff_af_queue_init(avctx, &s->afq);
240 240
241 /* create header packet bytes from header struct */241 /* create header packet bytes from header struct */
libavcodec/libtwolame.c+2−2
@@ -60,7 +60,7 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx) · 59 unmodified lines
60 int ret;60 int ret;
61 61
62 avctx->frame_size = TWOLAME_SAMPLES_PER_FRAME;62 avctx->frame_size = TWOLAME_SAMPLES_PER_FRAME;
63 avctx->delay = 512 - 32 + 1;63 avctx->initial_padding = 512 - 32 + 1;
64 64
65 s->glopts = twolame_init();65 s->glopts = twolame_init();
66 if (!s->glopts)66 if (!s->glopts)
@@ -151,7 +151,7 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 84 unmodified lines
151 avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);151 avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
152 if (frame) {152 if (frame) {
153 if (frame->pts != AV_NOPTS_VALUE)153 if (frame->pts != AV_NOPTS_VALUE)
154 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);154 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
155 } else {155 } else {
156 avpkt->pts = s->next_pts;156 avpkt->pts = s->next_pts;
157 }157 }
libavcodec/libvo-aacenc.c+1−1
@@ -61,7 +61,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 60 unmodified lines
61 int index, ret;61 int index, ret;
62 62
63 avctx->frame_size = FRAME_SIZE;63 avctx->frame_size = FRAME_SIZE;
64 avctx->delay = ENC_DELAY;64 avctx->initial_padding = ENC_DELAY;
65 s->last_frame = 2;65 s->last_frame = 2;
66 ff_af_queue_init(avctx, &s->afq);66 ff_af_queue_init(avctx, &s->afq);
67 67
libavcodec/libvo-amrwbenc.c+2−2
@@ -93,7 +93,7 @@ static av_cold int amr_wb_encode_init(AVCodecContext *avctx) · 92 unmodified lines
93 s->last_bitrate = avctx->bit_rate;93 s->last_bitrate = avctx->bit_rate;
94 94
95 avctx->frame_size = 320;95 avctx->frame_size = 320;
96 avctx->delay = 80;96 avctx->initial_padding = 80;
97 97
98 s->state = E_IF_init();98 s->state = E_IF_init();
99 99
@@ -131,7 +131,7 @@ static int amr_wb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 31 unmodified lines
131 }131 }
132 132
133 if (frame->pts != AV_NOPTS_VALUE)133 if (frame->pts != AV_NOPTS_VALUE)
134 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);134 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
135 135
136 avpkt->size = size;136 avpkt->size = size;
137 *got_packet_ptr = 1;137 *got_packet_ptr = 1;
libavcodec/libvorbis.c+2−2
@@ -322,8 +322,8 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 321 unmodified lines
322 if (duration > 0) {322 if (duration > 0) {
323 /* we do not know encoder delay until we get the first packet from323 /* we do not know encoder delay until we get the first packet from
324 * libvorbis, so we have to update the AudioFrameQueue counts */324 * libvorbis, so we have to update the AudioFrameQueue counts */
325 if (!avctx->delay) {325 if (!avctx->initial_padding) {
326 avctx->delay = duration;326 avctx->initial_padding = duration;
327 s->afq.remaining_delay += duration;327 s->afq.remaining_delay += duration;
328 s->afq.remaining_samples += duration;328 s->afq.remaining_samples += duration;
329 }329 }
libavcodec/mpegaudioenc.c+2−2
@@ -84,7 +84,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) · 83 unmodified lines
84 bitrate = bitrate / 1000;84 bitrate = bitrate / 1000;
85 s->nb_channels = channels;85 s->nb_channels = channels;
86 avctx->frame_size = MPA_FRAME_SIZE;86 avctx->frame_size = MPA_FRAME_SIZE;
87 avctx->delay = 512 - 32 + 1;87 avctx->initial_padding = 512 - 32 + 1;
88 88
89 /* encoding freq */89 /* encoding freq */
90 s->lsf = 0;90 s->lsf = 0;
@@ -735,7 +735,7 @@ static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 644 unmodified lines
735 encode_frame(s, bit_alloc, padding);735 encode_frame(s, bit_alloc, padding);
736 736
737 if (frame->pts != AV_NOPTS_VALUE)737 if (frame->pts != AV_NOPTS_VALUE)
738 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);738 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
739 739
740 avpkt->size = put_bits_count(&s->pb) / 8;740 avpkt->size = put_bits_count(&s->pb) / 8;
741 *got_packet_ptr = 1;741 *got_packet_ptr = 1;
libavcodec/nellymoserenc.c+1−1
@@ -165,7 +165,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 164 unmodified lines
165 }165 }
166 166
167 avctx->frame_size = NELLY_SAMPLES;167 avctx->frame_size = NELLY_SAMPLES;
168 avctx->delay = NELLY_BUF_LEN;168 avctx->initial_padding = NELLY_BUF_LEN;
169 ff_af_queue_init(avctx, &s->afq);169 ff_af_queue_init(avctx, &s->afq);
170 s->avctx = avctx;170 s->avctx = avctx;
171 if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0)171 if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0)
libavcodec/ra144enc.c+1−1
@@ -56,7 +56,7 @@ static av_cold int ra144_encode_init(AVCodecContext * avctx) · 55 unmodified lines
56 return -1;56 return -1;
57 }57 }
58 avctx->frame_size = NBLOCKS * BLOCKSIZE;58 avctx->frame_size = NBLOCKS * BLOCKSIZE;
59 avctx->delay = avctx->frame_size;59 avctx->initial_padding = avctx->frame_size;
60 avctx->bit_rate = 8000;60 avctx->bit_rate = 8000;
61 ractx = avctx->priv_data;61 ractx = avctx->priv_data;
62 ractx->lpc_coef[0] = ractx->lpc_tables[0];62 ractx->lpc_coef[0] = ractx->lpc_tables[0];
libavcodec/utils.c+9−0
@@ -1240,6 +1240,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code · 1239 unmodified lines
1240 }1240 }
1241 }1241 }
1242 1242
1243#if FF_API_AUDIOENC_DELAY
1244 if (av_codec_is_encoder(avctx->codec))
1245 avctx->delay = avctx->initial_padding;
1246#endif
1247
1243 if (av_codec_is_decoder(avctx->codec)) {1248 if (av_codec_is_decoder(avctx->codec)) {
1244 /* validate channel layout from the decoder */1249 /* validate channel layout from the decoder */
1245 if (avctx->channel_layout) {1250 if (avctx->channel_layout) {
@@ -1447,6 +1452,10 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, · 201 unmodified lines
1447end:1452end:
1448 av_frame_free(&padded_frame);1453 av_frame_free(&padded_frame);
1449 1454
1455#if FF_API_AUDIOENC_DELAY
1456 avctx->delay = avctx->initial_padding;
1457#endif
1458
1450 return ret;1459 return ret;
1451}1460}
1452 1461
libavcodec/version.h+5−2
@@ -29,8 +29,8 @@ · 28 unmodified lines
29#include "libavutil/version.h"29#include "libavutil/version.h"
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5631#define LIBAVCODEC_VERSION_MAJOR 56
32#define LIBAVCODEC_VERSION_MINOR 232#define LIBAVCODEC_VERSION_MINOR 3
33#define LIBAVCODEC_VERSION_MICRO 233#define LIBAVCODEC_VERSION_MICRO 0
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36 LIBAVCODEC_VERSION_MINOR, \36 LIBAVCODEC_VERSION_MINOR, \
@@ -153,5 +153,8 @@ · 116 unmodified lines
153#ifndef FF_API_AFD153#ifndef FF_API_AFD
154#define FF_API_AFD (LIBAVCODEC_VERSION_MAJOR < 57)154#define FF_API_AFD (LIBAVCODEC_VERSION_MAJOR < 57)
155#endif155#endif
156#ifndef FF_API_AUDIOENC_DELAY
157#define FF_API_AUDIOENC_DELAY (LIBAVCODEC_VERSION_MAJOR < 58)
158#endif
156 159
157#endif /* AVCODEC_VERSION_H */160#endif /* AVCODEC_VERSION_H */
libavcodec/wmaenc.c+2−3
@@ -92,8 +92,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 91 unmodified lines
92 avctx->block_align = block_align;92 avctx->block_align = block_align;
93 avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate /93 avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate /
94 s->frame_len;94 s->frame_len;
95 avctx->frame_size =95 avctx->frame_size = avctx->initial_padding = s->frame_len;
96 avctx->delay = s->frame_len;
97 96
98 return 0;97 return 0;
99}98}
@@ -420,7 +419,7 @@ static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt, · 320 unmodified lines
420 flush_put_bits(&s->pb);419 flush_put_bits(&s->pb);
421 420
422 if (frame->pts != AV_NOPTS_VALUE)421 if (frame->pts != AV_NOPTS_VALUE)
423 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);422 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
424 423
425 avpkt->size = avctx->block_align;424 avpkt->size = avctx->block_align;
426 *got_packet_ptr = 1;425 *got_packet_ptr = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t