[FFmpeg-soc] [soc]: r3271 - mxf/mxfenc.c

spyfeng subversion at mplayerhq.hu
Thu Aug 14 16:45:37 CEST 2008


Author: spyfeng
Date: Thu Aug 14 16:45:37 2008
New Revision: 3271

Log:
check url_is_streamed() before url_fseek()


Modified:
   mxf/mxfenc.c

Modified: mxf/mxfenc.c
==============================================================================
--- mxf/mxfenc.c	(original)
+++ mxf/mxfenc.c	Thu Aug 14 16:45:37 2008
@@ -1018,13 +1018,18 @@ static int mxf_update_header_partition(A
     MXFContext *mxf = s->priv_data;
     ByteIOContext *pb = s->pb;
 
-    url_fseek(pb, mxf->header_byte_count_offset, SEEK_SET);
-    put_be64(pb, mxf->header_byte_count);
-    put_flush_packet(pb);
+    if (!url_is_streamed(s->pb)) {
+        url_fseek(pb, mxf->header_byte_count_offset, SEEK_SET);
+        put_be64(pb, mxf->header_byte_count);
+        put_flush_packet(pb);
 
-    url_fseek(pb, mxf->header_footer_partition_offset, SEEK_SET);
-    put_be64(pb, footer_partition_offset);
-    put_flush_packet(pb);
+        url_fseek(pb, mxf->header_footer_partition_offset, SEEK_SET);
+        put_be64(pb, footer_partition_offset);
+        put_flush_packet(pb);
+    } else {
+        av_log(s, AV_LOG_ERROR, "update header partition failed, non streamble out put\n");
+        return -1;
+    }
     return 0;
 }
 



More information about the FFmpeg-soc mailing list