1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-29 10:32:15 +00:00

Revert "demux/packet: fix demux_packet_shorten"

This reverts commit 95636c65e7.

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).
This commit is contained in:
wm4 2019-09-19 17:38:35 +02:00
parent e60bcf0d98
commit 9a7a6958ca

View File

@ -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)