History

Merge commit '59444c76e6d43529a12dbd80b6dd29c6ba4079a9'

* commit '59444c76e6d43529a12dbd80b6dd29c6ba4079a9': avconv: add stream-global side data to the first demuxed packet Conflicts: ffmpeg.c

Michael Niedermayer committed 12 years ago

Commit 82e66602 parents c08e523 59444c72 files · +20 −0Browse files

Unified · Split

2 files
  1. ffmpeg.c +17 −0
  2. ffmpeg.h +3 −0
ffmpeg.c+17−0
@@ -3174,6 +3174,7 @@ static int process_input(int file_index) · 3173 unmodified lines
31743174 }
31753175
31763176 ist = input_streams[ifile->ist_index + pkt.stream_index];
3177+ ist->nb_packets++;
31773178 if (ist->discard)
31783179 goto discard_packet;
31793180
@@ -3224,6 +3225,22 @@ static int process_input(int file_index) · 44 unmodified lines
32243225 }
32253226 }
32263227
3228+ /* add the stream-global side data to the first packet */
3229+ if (ist->nb_packets == 1)
3230+ for (i = 0; i < ist->st->nb_side_data; i++) {
3231+ AVPacketSideData *src_sd = &ist->st->side_data[i];
3232+ uint8_t *dst_data;
3233+
3234+ if (av_packet_get_side_data(&pkt, src_sd->type, NULL))
3235+ continue;
3236+
3237+ dst_data = av_packet_new_side_data(&pkt, src_sd->type, src_sd->size);
3238+ if (!dst_data)
3239+ exit_program(1);
3240+
3241+ memcpy(dst_data, src_sd->data, src_sd->size);
3242+ }
3243+
32273244 if (pkt.dts != AV_NOPTS_VALUE)
32283245 pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
32293246 if (pkt.pts != AV_NOPTS_VALUE)
ffmpeg.h+3−0
@@ -262,6 +262,9 @@ typedef struct InputStream { · 261 unmodified lines
262262 int top_field_first;
263263 int guess_layout_max;
264264
265+ /* number of packets successfully read for this stream */
266+ uint64_t nb_packets;
267+
265268 int resample_height;
266269 int resample_width;
267270 int resample_pix_fmt;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t