]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Use chunk-size in function calling mdpr_read_codecdata() rather than in the
authorrbultje <rbultje@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 3 Sep 2008 00:05:55 +0000 (00:05 +0000)
committerrbultje <rbultje@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 3 Sep 2008 00:05:55 +0000 (00:05 +0000)
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".

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15163 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/rm.h
libavformat/rmdec.c

index 802af747753cfdb90359caa7a492f74be7d06c88..a57e517baba1a5543f6de02225c9d5bb27e82976 100644 (file)
@@ -70,9 +70,10 @@ typedef struct {
  * @param s context containing RMContext and ByteIOContext for stream reading
  * @param st the stream that the MDPR chunk belongs to and where to store the
  *           parameters read from the chunk into
+ * @param codec_data_size size of the MDPR chunk
  * @return 0 on success, errno codes on error
  */
-int ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVStream *st);
+int ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVStream *st, int codec_data_size);
 
 /**
  * Parse one rm-stream packet from the input bytestream.
index aa8bda7e3c6aeec755dc76ef724303dfada80cf0..6414fa771ab97a28dcd9551f76059b1c62ef133a 100644 (file)
@@ -190,14 +190,13 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,
 }
 
 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 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
             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'):