mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
pts fix by (Bryan Mayland / bmayland O leoninedev o com)
Originally committed as revision 4867 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
950c2790a2
commit
d271481f1a
@ -44,6 +44,7 @@ typedef struct FFMContext {
|
|||||||
|
|
||||||
/* read and write */
|
/* read and write */
|
||||||
int first_packet; /* true if first packet, needed to set the discontinuity tag */
|
int first_packet; /* true if first packet, needed to set the discontinuity tag */
|
||||||
|
int first_frame_in_packet; /* true if first frame in packet, needed to know if PTS information is valid */
|
||||||
int packet_size;
|
int packet_size;
|
||||||
int frame_offset;
|
int frame_offset;
|
||||||
int64_t pts;
|
int64_t pts;
|
||||||
@ -347,6 +348,7 @@ static int ffm_read_data(AVFormatContext *s,
|
|||||||
get_be16(pb); /* PACKET_ID */
|
get_be16(pb); /* PACKET_ID */
|
||||||
fill_size = get_be16(pb);
|
fill_size = get_be16(pb);
|
||||||
ffm->pts = get_be64(pb);
|
ffm->pts = get_be64(pb);
|
||||||
|
ffm->first_frame_in_packet = 1;
|
||||||
frame_offset = get_be16(pb);
|
frame_offset = get_be16(pb);
|
||||||
get_buffer(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE);
|
get_buffer(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE);
|
||||||
ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
|
ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
|
||||||
@ -614,7 +616,11 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
av_free_packet(pkt);
|
av_free_packet(pkt);
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
pkt->pts = ffm->pts;
|
if (ffm->first_frame_in_packet)
|
||||||
|
{
|
||||||
|
pkt->pts = ffm->pts;
|
||||||
|
ffm->first_frame_in_packet = 0;
|
||||||
|
}
|
||||||
pkt->duration = duration;
|
pkt->duration = duration;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user