mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit '59444c76e6d43529a12dbd80b6dd29c6ba4079a9'
* commit '59444c76e6d43529a12dbd80b6dd29c6ba4079a9': avconv: add stream-global side data to the first demuxed packet Conflicts: ffmpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
82e6660ae2
17
ffmpeg.c
17
ffmpeg.c
@ -3174,6 +3174,7 @@ static int process_input(int file_index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ist = input_streams[ifile->ist_index + pkt.stream_index];
|
ist = input_streams[ifile->ist_index + pkt.stream_index];
|
||||||
|
ist->nb_packets++;
|
||||||
if (ist->discard)
|
if (ist->discard)
|
||||||
goto discard_packet;
|
goto discard_packet;
|
||||||
|
|
||||||
@ -3224,6 +3225,22 @@ static int process_input(int file_index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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)
|
if (pkt.dts != AV_NOPTS_VALUE)
|
||||||
pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
|
pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
|
||||||
if (pkt.pts != AV_NOPTS_VALUE)
|
if (pkt.pts != AV_NOPTS_VALUE)
|
||||||
|
3
ffmpeg.h
3
ffmpeg.h
@ -262,6 +262,9 @@ typedef struct InputStream {
|
|||||||
int top_field_first;
|
int top_field_first;
|
||||||
int guess_layout_max;
|
int guess_layout_max;
|
||||||
|
|
||||||
|
/* number of packets successfully read for this stream */
|
||||||
|
uint64_t nb_packets;
|
||||||
|
|
||||||
int resample_height;
|
int resample_height;
|
||||||
int resample_width;
|
int resample_width;
|
||||||
int resample_pix_fmt;
|
int resample_pix_fmt;
|
||||||
|
Loading…
Reference in New Issue
Block a user