mirror of https://git.ffmpeg.org/ffmpeg.git
lavf: inject sample skip side data when requested by the demuxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c916af995d
commit
018601dbf9
|
@ -805,6 +805,11 @@ typedef struct AVStream {
|
||||||
* should be discarded.
|
* should be discarded.
|
||||||
*/
|
*/
|
||||||
int skip_to_keyframe;
|
int skip_to_keyframe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of samples to skip at the start of the frame decoded from the next packet.
|
||||||
|
*/
|
||||||
|
int skip_samples;
|
||||||
} AVStream;
|
} AVStream;
|
||||||
|
|
||||||
#define AV_PROGRAM_RUNNING 1
|
#define AV_PROGRAM_RUNNING 1
|
||||||
|
|
|
@ -1450,6 +1450,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
|
||||||
}
|
}
|
||||||
|
|
||||||
return_packet:
|
return_packet:
|
||||||
|
|
||||||
|
if(s->streams[pkt->stream_index]->skip_samples) {
|
||||||
|
uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10);
|
||||||
|
AV_WL32(p, s->streams[pkt->stream_index]->skip_samples);
|
||||||
|
av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", s->streams[pkt->stream_index]->skip_samples);
|
||||||
|
s->streams[pkt->stream_index]->skip_samples = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_relative(pkt->dts))
|
if (is_relative(pkt->dts))
|
||||||
pkt->dts -= RELATIVE_TS_BASE;
|
pkt->dts -= RELATIVE_TS_BASE;
|
||||||
if (is_relative(pkt->pts))
|
if (is_relative(pkt->pts))
|
||||||
|
|
Loading…
Reference in New Issue