* commit '59444c76e6d43529a12dbd80b6dd29c6ba4079a9': avconv: add stream-global side data to the first demuxed packet Conflicts: ffmpeg.c
Unified · Split
| @@ -3174,6 +3174,7 @@ static int process_input(int file_index) · 3173 unmodified lines | ||
| 3174 | 3174 | } |
| 3175 | 3175 | |
| 3176 | 3176 | ist = input_streams[ifile->ist_index + pkt.stream_index]; |
| 3177 | + ist->nb_packets++; | |
| 3177 | 3178 | if (ist->discard) |
| 3178 | 3179 | goto discard_packet; |
| 3179 | 3180 | |
| @@ -3224,6 +3225,22 @@ static int process_input(int file_index) · 44 unmodified lines | ||
| 3224 | 3225 | } |
| 3225 | 3226 | } |
| 3226 | 3227 | |
| 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 | + | |
| 3227 | 3244 | if (pkt.dts != AV_NOPTS_VALUE) |
| 3228 | 3245 | pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base); |
| 3229 | 3246 | if (pkt.pts != AV_NOPTS_VALUE) |
| @@ -262,6 +262,9 @@ typedef struct InputStream { · 261 unmodified lines | ||
| 262 | 262 | int top_field_first; |
| 263 | 263 | int guess_layout_max; |
| 264 | 264 | |
| 265 | + /* number of packets successfully read for this stream */ | |
| 266 | + uint64_t nb_packets; | |
| 267 | + | |
| 265 | 268 | int resample_height; |
| 266 | 269 | int resample_width; |
| 267 | 270 | int resample_pix_fmt; |