decoder/ffmpeg: call decoder_timestamp() once per packet
This commit is contained in:
parent
8914ebc964
commit
2acad9fe1e
@ -181,6 +181,11 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
|
|||||||
uint8_t *packet_data;
|
uint8_t *packet_data;
|
||||||
int packet_size;
|
int packet_size;
|
||||||
|
|
||||||
|
if (packet->pts != (int64_t)AV_NOPTS_VALUE)
|
||||||
|
decoder_timestamp(decoder,
|
||||||
|
av_rescale_q(packet->pts, *time_base,
|
||||||
|
(AVRational){1, 1}));
|
||||||
|
|
||||||
packet_data = packet->data;
|
packet_data = packet->data;
|
||||||
packet_size = packet->size;
|
packet_size = packet->size;
|
||||||
|
|
||||||
@ -205,11 +210,6 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
|
|||||||
if (audio_size <= 0)
|
if (audio_size <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (packet->pts != (int64_t)AV_NOPTS_VALUE)
|
|
||||||
decoder_timestamp(decoder,
|
|
||||||
av_rescale_q(packet->pts, *time_base,
|
|
||||||
(AVRational){1, 1}));
|
|
||||||
|
|
||||||
cmd = decoder_data(decoder, is,
|
cmd = decoder_data(decoder, is,
|
||||||
aligned_buffer, audio_size,
|
aligned_buffer, audio_size,
|
||||||
codec_context->bit_rate / 1000);
|
codec_context->bit_rate / 1000);
|
||||||
|
Loading…
Reference in New Issue
Block a user