summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-24 16:39:15 +0100
committerwm4 <wm4@nowhere>2016-03-24 16:39:15 +0100
commitf0febc35eb0bf7376e31e3d325a84b532aa2b886 (patch)
tree8b7b35fa5a46c6c1930f22f1ea6628ea3def85b7 /audio
parentb34befbab8b7d42447592a3c6652fbf73d51f762 (diff)
downloadmpv-f0febc35eb0bf7376e31e3d325a84b532aa2b886.tar.bz2
mpv-f0febc35eb0bf7376e31e3d325a84b532aa2b886.tar.xz
ad_lavc: add codec_timebase hack too
vd_lavc.c had this, and soon I'll need it in ad_lavc.c too. For now it's unused.
Diffstat (limited to 'audio')
-rw-r--r--audio/decode/ad_lavc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index c30aff7fd5..0c61c03986 100644
--- a/audio/decode/ad_lavc.c
+++ b/audio/decode/ad_lavc.c
@@ -45,6 +45,7 @@ struct priv {
uint32_t skip_samples, trim_samples;
bool preroll_done;
double next_pts;
+ AVRational codec_timebase;
};
static void uninit(struct dec_audio *da);
@@ -84,6 +85,8 @@ static int init(struct dec_audio *da, const char *decoder)
struct priv *ctx = talloc_zero(NULL, struct priv);
da->priv = ctx;
+ ctx->codec_timebase = (AVRational){0};
+
ctx->force_channel_map = c->force_channels;
lavc_codec = avcodec_find_decoder_by_name(decoder);
@@ -185,7 +188,7 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt,
int in_len = mpkt ? mpkt->len : 0;
AVPacket pkt;
- mp_set_av_packet(&pkt, mpkt, NULL);
+ mp_set_av_packet(&pkt, mpkt, &priv->codec_timebase);
int got_frame = 0;
av_frame_unref(priv->avframe);
@@ -212,7 +215,7 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt,
if (!got_frame)
return 0;
- double out_pts = mp_pts_from_av(priv->avframe->pkt_pts, NULL);
+ double out_pts = mp_pts_from_av(priv->avframe->pkt_pts, &priv->codec_timebase);
struct mp_audio *mpframe = mp_audio_from_avframe(priv->avframe);
if (!mpframe)