summaryrefslogtreecommitdiffstats
path: root/demux/demux_packet.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-21 22:03:35 +0200
committerwm4 <wm4@nowhere>2013-05-21 22:07:13 +0200
commitb477c68aa084d202de24dc02cb008871d218f976 (patch)
tree64f342b671e6ba5fd10242b239ba3fd970205361 /demux/demux_packet.h
parente8be12158086e1099dfee0fc6d8cc75a1ec20cb7 (diff)
downloadmpv-b477c68aa084d202de24dc02cb008871d218f976.tar.bz2
mpv-b477c68aa084d202de24dc02cb008871d218f976.tar.xz
demux: workaround for -demuxer mpegts -correct-pts
Using -demuxer mpegts -correct-pts triggered the assertion in ds_get_packet2(). This is not surprising, because the correct-pts code was changed to accept _complete_ packets, while all the old demuxers (including the mpegts demuxer) require you to use "partial" packet reads, together with the video_read_frame(). (That function actually parses video frames, so fragments of the original "packets" can be fed to the decoder.) However, it returns out demux_ts packet's are mostly useable. demux_ts still adds an offset (i.e. ds->buffer_pos != 0) to the packets when calling internal parser functions, such as in parse_es.c. While this is unclean design due to mplayer's old video demuxing/decoding path, it can be easily be made work by modifying the packet as returned by ds_get_packet2(). We also have to change the packet freeing code, as demux_packet->buffer doesn't have to point to the start of the memory allocation anymore. MPlayer handles this "correctly" because it doesn't have a function that reads a complete packet.
Diffstat (limited to 'demux/demux_packet.h')
-rw-r--r--demux/demux_packet.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/demux/demux_packet.h b/demux/demux_packet.h
index 39f10b9b74..25731d914a 100644
--- a/demux/demux_packet.h
+++ b/demux/demux_packet.h
@@ -32,6 +32,7 @@ typedef struct demux_packet {
unsigned char *buffer;
bool keyframe;
struct demux_packet *next;
+ void *allocation;
struct AVPacket *avpacket; // original libavformat packet (demux_lavf)
} demux_packet_t;