On Apr 28, 2011, at 1:35 PM, Dennis Munsie wrote:

> Hi everyone --
> 
> I might be missing something, but it doesn't appear that the PTS field in 
> AVPacket is preserved when decoding an h.264 frame.  The AVFrame that gets 
> returned has PTS set to AV_NOPTS_VALUE.  Is this the desired behavior?  If I 
> put together a patch that preserved the PTS field, would that be something 
> others are interested in?
> 
> Thanks!
> dennis

I went ahead and put together a patch for this anyway.  I'm pretty sure that 
this is the correct way to do it, but would appreciate any feedback on this.

dennis

----

 libavcodec/h264.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 264afe5..980cd6d 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3021,6 +3021,8 @@ static int decode_frame(AVCodecContext *avctx,
         Picture *cur = s->current_picture_ptr;
         int i, pics, out_of_order, out_idx;
 
+        cur->pts = avpkt->pts;
+
         field_end(h);
 
         if (cur->field_poc[0]==INT_MAX || cur->field_poc[1]==INT_MAX) {

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to