diff options
author | wm4 <wm4@nowhere> | 2013-06-03 01:55:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-03 22:40:07 +0200 |
commit | 9f4261de65c18d3a34e70c9f969966ca85c80a8d (patch) | |
tree | f9a563589dff67799230508bcc87fe8001fc0ef1 /audio | |
parent | 13a1ce16f9581871cf7ac0d06ece407534a98f89 (diff) | |
download | mpv-9f4261de65c18d3a34e70c9f969966ca85c80a8d.tar.bz2 mpv-9f4261de65c18d3a34e70c9f969966ca85c80a8d.tar.xz |
core: add common function to initialize AVPacket
Audio and video had their own (very similar) functions to initialize an
AVPacket (ffmpeg's packet struct) from a demux_packet (mplayer's packet
struct). Add a common function for these.
Also use this function for sd_lavc_conv. This is actually a functional
change, as some libavfilter subtitle demuxers add weird out-of-band
stuff as side-data.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/decode/ad_lavc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index 8abc0a6035..b5a4ee1ef8 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -402,13 +402,10 @@ static int decode_new_packet(struct sh_audio *sh) } AVPacket pkt; - av_init_packet(&pkt); + mp_set_av_packet(&pkt, mpkt); pkt.data = start; pkt.size = insize; - if (mpkt && mpkt->avpacket) { - pkt.side_data = mpkt->avpacket->side_data; - pkt.side_data_elems = mpkt->avpacket->side_data_elems; - } + if (pts != MP_NOPTS_VALUE && !packet_already_used) { sh->pts = pts; sh->pts_bytes = 0; |