aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-01-18 13:11:04 +0100
committerMax Kellermann <max@duempel.org>2010-01-18 13:11:04 +0100
commit2acad9fe1e4eb566ea497f032cb781d2e901543a (patch)
tree47702c65437d8c2844b746459055bda01d8a9b51 /src
parent8914ebc9649cd6be6fd078d0bf1200b79aade7cb (diff)
downloadmpd-2acad9fe1e4eb566ea497f032cb781d2e901543a.tar.gz
mpd-2acad9fe1e4eb566ea497f032cb781d2e901543a.tar.xz
mpd-2acad9fe1e4eb566ea497f032cb781d2e901543a.zip
decoder/ffmpeg: call decoder_timestamp() once per packet
Diffstat (limited to 'src')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index 369e8d426..678bba6fa 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -181,6 +181,11 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
uint8_t *packet_data;
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_size = packet->size;
@@ -205,11 +210,6 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
if (audio_size <= 0)
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,
aligned_buffer, audio_size,
codec_context->bit_rate / 1000);