summaryrefslogtreecommitdiffstats
path: root/demux/packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'demux/packet.h')
-rw-r--r--demux/packet.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/demux/packet.h b/demux/packet.h
index f4570004e8..cd1183d417 100644
--- a/demux/packet.h
+++ b/demux/packet.h
@@ -29,16 +29,29 @@ typedef struct demux_packet {
double duration;
int64_t pos; // position in source file byte stream
- unsigned char *buffer;
- size_t len;
+ union {
+ // Normally valid for packets.
+ struct {
+ unsigned char *buffer;
+ size_t len;
+ };
+
+ // Used if is_cached==true, special uses only.
+ struct {
+ uint64_t pos;
+ } cached_data;
+ };
int stream; // source stream index (typically sh_stream.index)
bool keyframe;
// backward playback
- bool back_restart; // restart point (reverse and return previous frames)
- bool back_preroll; // initial discarded frame for smooth decoder reinit
+ bool back_restart : 1; // restart point (reverse and return previous frames)
+ bool back_preroll : 1; // initial discarded frame for smooth decoder reinit
+
+ // If true, cached_data is valid, while buffer/len are not.
+ bool is_cached : 1;
// segmentation (ordered chapters, EDL)
bool segmented;
@@ -68,4 +81,6 @@ int demux_packet_set_padding(struct demux_packet *dp, int start, int end);
int demux_packet_add_blockadditional(struct demux_packet *dp, uint64_t id,
void *data, size_t size);
+void demux_packet_unref_contents(struct demux_packet *dp);
+
#endif /* MPLAYER_DEMUX_PACKET_H */