summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-02-19 18:49:48 +0100
committerAnton Khirnov <anton@khirnov.net>2014-03-24 06:07:51 +0100
commit59444c76e6d43529a12dbd80b6dd29c6ba4079a9 (patch)
treed9c1133972a4d36d7a4ceac2642285ea5bfcf68f /avconv.c
parent4a0f6651434c6f213d830140f575b4ec7858519f (diff)
avconv: add stream-global side data to the first demuxed packet
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 13e6778dec..bf40d45253 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2223,9 +2223,26 @@ static int process_input(void)
goto discard_packet;
ist = input_streams[ifile->ist_index + pkt.stream_index];
+ ist->nb_packets++;
if (ist->discard)
goto discard_packet;
+ /* add the stream-global side data to the first packet */
+ if (ist->nb_packets == 1)
+ for (i = 0; i < ist->st->nb_side_data; i++) {
+ AVPacketSideData *src_sd = &ist->st->side_data[i];
+ uint8_t *dst_data;
+
+ if (av_packet_get_side_data(&pkt, src_sd->type, NULL))
+ continue;
+
+ dst_data = av_packet_new_side_data(&pkt, src_sd->type, src_sd->size);
+ if (!dst_data)
+ exit_program(1);
+
+ memcpy(dst_data, src_sd->data, src_sd->size);
+ }
+
if (pkt.dts != AV_NOPTS_VALUE)
pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
if (pkt.pts != AV_NOPTS_VALUE)