[Ffmpeg-cvslog] CVS: ffmpeg/libavformat ffm.c,1.49,1.50
Michael Niedermayer CVS
michael
Thu Jan 19 01:54:13 CET 2006
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv8151
Modified Files:
ffm.c
Log Message:
pts fix by (Bryan Mayland / bmayland O leoninedev o com)
Index: ffm.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/ffm.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- ffm.c 12 Jan 2006 22:43:22 -0000 1.49
+++ ffm.c 19 Jan 2006 00:54:10 -0000 1.50
@@ -44,6 +44,7 @@
/* read and write */
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 frame_offset;
int64_t pts;
@@ -347,6 +348,7 @@
get_be16(pb); /* PACKET_ID */
fill_size = get_be16(pb);
ffm->pts = get_be64(pb);
+ ffm->first_frame_in_packet = 1;
frame_offset = get_be16(pb);
get_buffer(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE);
ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
@@ -614,7 +616,11 @@
av_free_packet(pkt);
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;
break;
}
More information about the ffmpeg-cvslog
mailing list