diff rmdec.c @ 3873:9a589ae59655 libavformat

Use chunk-size in function calling mdpr_read_codecdata() rather than in the function itself. This way, old-style (.ra4) RTSP/RDT OpaqueData chunks can be parsed using this function as well (they don't have the size bits). See discussion on ML in "[PATCH] rmdec.c - small read_mdpr_codecdata() API modification".
author rbultje
date Wed, 03 Sep 2008 00:05:55 +0000
parents f9c75fed4805
children d50c5556cb82
line wrap: on
line diff
--- a/rmdec.c	Tue Sep 02 22:53:42 2008 +0000
+++ b/rmdec.c	Wed Sep 03 00:05:55 2008 +0000
@@ -190,14 +190,13 @@
 }
 
 int
-ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVStream *st)
+ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVStream *st, int codec_data_size)
 {
     ByteIOContext *pb = s->pb;
     unsigned int v;
-    int codec_data_size, size;
+    int size;
     int64_t codec_pos;
 
-    codec_data_size = get_be32(pb);
     codec_pos = url_ftell(pb);
     v = get_be32(pb);
     if (v == MKTAG(0xfd, 'a', 'r', '.')) {
@@ -351,7 +350,7 @@
             get_str8(pb, buf, sizeof(buf)); /* mimetype */
             st->codec->codec_type = CODEC_TYPE_DATA;
             av_set_pts_info(st, 64, 1, 1000);
-            if (ff_rm_read_mdpr_codecdata(s, st) < 0)
+            if (ff_rm_read_mdpr_codecdata(s, st, get_be32(pb)) < 0)
                 return -1;
             break;
         case MKTAG('D', 'A', 'T', 'A'):