summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-16 21:28:59 +0100
committerwm4 <wm4@nowhere>2013-11-16 21:46:17 +0100
commitfde0e9e84db52cb918c12c7860aa5260f344c335 (patch)
tree595ab2c6d875c216f549f62ee1cbb75d1df85897 /demux
parent5957f828b0e5cc2cb9953dc237b2c3f32f59a31b (diff)
downloadmpv-fde0e9e84db52cb918c12c7860aa5260f344c335.tar.bz2
mpv-fde0e9e84db52cb918c12c7860aa5260f344c335.tar.xz
demux_packet: add source stream index
Might be helpful later.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c4
-rw-r--r--demux/demux_packet.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 0078e72cdd..095c23fd0c 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -134,6 +134,7 @@ static struct demux_packet *create_packet(size_t len)
.duration = -1,
.stream_pts = MP_NOPTS_VALUE,
.pos = -1,
+ .stream = -1,
};
return dp;
}
@@ -322,6 +323,9 @@ int demuxer_add_packet(demuxer_t *demuxer, struct sh_stream *stream,
return 0;
}
+ dp->stream = stream->index;
+ dp->next = NULL;
+
ds->packs++;
ds->bytes += dp->len;
if (ds->tail) {
diff --git a/demux/demux_packet.h b/demux/demux_packet.h
index 0d1a6e6f03..f12ffc9a00 100644
--- a/demux/demux_packet.h
+++ b/demux/demux_packet.h
@@ -31,6 +31,7 @@ typedef struct demux_packet {
int64_t pos; // position in source file byte stream
unsigned char *buffer;
bool keyframe;
+ int stream; // source stream index
struct demux_packet *next;
void *allocation;
struct AVPacket *avpacket; // original libavformat packet (demux_lavf)