mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
Fix initialization of avpkt in output_packet().
Patch by Thilo Borgmann thilo.surname AT googlemaildotcom. Originally committed as revision 18451 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7ce0420983
commit
031e14ea79
8
ffmpeg.c
8
ffmpeg.c
@ -1185,24 +1185,22 @@ static int output_packet(AVInputStream *ist, int ist_index,
|
|||||||
int got_subtitle;
|
int got_subtitle;
|
||||||
AVPacket avpkt;
|
AVPacket avpkt;
|
||||||
|
|
||||||
av_init_packet(&avpkt);
|
|
||||||
|
|
||||||
if(ist->next_pts == AV_NOPTS_VALUE)
|
if(ist->next_pts == AV_NOPTS_VALUE)
|
||||||
ist->next_pts= ist->pts;
|
ist->next_pts= ist->pts;
|
||||||
|
|
||||||
if (pkt == NULL) {
|
if (pkt == NULL) {
|
||||||
/* EOF handling */
|
/* EOF handling */
|
||||||
|
av_init_packet(&avpkt);
|
||||||
avpkt.data = NULL;
|
avpkt.data = NULL;
|
||||||
avpkt.size = 0;
|
avpkt.size = 0;
|
||||||
goto handle_eof;
|
goto handle_eof;
|
||||||
|
} else {
|
||||||
|
avpkt = *pkt;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pkt->dts != AV_NOPTS_VALUE)
|
if(pkt->dts != AV_NOPTS_VALUE)
|
||||||
ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
|
ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
|
||||||
|
|
||||||
avpkt.size = pkt->size;
|
|
||||||
avpkt.data = pkt->data;
|
|
||||||
|
|
||||||
//while we have more to decode or while the decoder did output something on EOF
|
//while we have more to decode or while the decoder did output something on EOF
|
||||||
while (avpkt.size > 0 || (!pkt && ist->next_pts != ist->pts)) {
|
while (avpkt.size > 0 || (!pkt && ist->next_pts != ist->pts)) {
|
||||||
handle_eof:
|
handle_eof:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user