changeset 717:a79f89d39c3c libavformat

discard dummy packets before doing inapropriate checks on them and failing as a result
author michael
date Thu, 24 Mar 2005 01:51:57 +0000
parents 55081ada3aad
children ff85dfd59176
files utils.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Wed Mar 23 13:30:27 2005 +0000
+++ b/utils.c	Thu Mar 24 01:51:57 2005 +0000
@@ -2301,12 +2301,13 @@
 int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
     AVStream *st= s->streams[ pkt->stream_index];
 
-    if(compute_pkt_fields2(st, pkt) < 0)
-        return -1;
-    
     //FIXME/XXX/HACK drop zero sized packets
     if(st->codec.codec_type == CODEC_TYPE_AUDIO && pkt->size==0)
         return 0;
+
+//av_log(NULL, AV_LOG_DEBUG, "av_interleaved_write_frame %d %Ld %Ld\n", pkt->size, pkt->dts, pkt->pts);
+    if(compute_pkt_fields2(st, pkt) < 0)
+        return -1;
     
     if(pkt->dts == AV_NOPTS_VALUE)
         return -1;