diff options
author | wm4 <wm4@nowhere> | 2019-09-19 17:38:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:05 +0200 |
commit | 9a7a6958cac2174e1e9e9d61db6d8e295086aae2 (patch) | |
tree | 288e7772c70de1ba273db465cf3b5f31504c4dab /demux/packet.c | |
parent | e60bcf0d9814da076ccdf1abb1a0b5a0af149f38 (diff) | |
download | mpv-9a7a6958cac2174e1e9e9d61db6d8e295086aae2.tar.bz2 mpv-9a7a6958cac2174e1e9e9d61db6d8e295086aae2.tar.xz |
Revert "demux/packet: fix demux_packet_shorten"
This reverts commit 95636c65e73c1d0d8cba43d8c230291d99962e88.
This change shouldn't be needed, and in fact it's wrong. The FFmpeg API
function could do anything it wants with the packet, including changing
the packet data pointer. Likewise, it's not guaranteed that the
referenced packet's fields mirror the current state of the mpv packet
struct (the AVPacket is only kept for the AVBuffer and the side data
stuff).
Diffstat (limited to 'demux/packet.c')
-rw-r--r-- | demux/packet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/demux/packet.c b/demux/packet.c index b456df4ab2..fba9232c19 100644 --- a/demux/packet.c +++ b/demux/packet.c @@ -124,8 +124,8 @@ struct demux_packet *new_demux_packet(size_t len) void demux_packet_shorten(struct demux_packet *dp, size_t len) { assert(len <= dp->len); - av_shrink_packet(dp->avpacket, len); - dp->len = dp->avpacket->size; + dp->len = len; + memset(dp->buffer + dp->len, 0, AV_INPUT_BUFFER_PADDING_SIZE); } void free_demux_packet(struct demux_packet *dp) |