r3d: do not create the audio stream until we know the sample rate
[ffmpeg.git] / libavformat / ingenientdec.c
index 50a4357..2bb70e7 100644 (file)
@@ -51,21 +51,23 @@ static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
     pkt->stream_index = 0;
     ret = avio_read(s->pb, pkt->data, size);
     if (ret < 0) {
-        av_free_packet(pkt);
+        av_packet_unref(pkt);
         return ret;
     }
     pkt->size = ret;
     return ret;
 }
 
+FF_RAWVIDEO_DEMUXER_CLASS(ingenient)
+
 AVInputFormat ff_ingenient_demuxer = {
     .name           = "ingenient",
     .long_name      = NULL_IF_CONFIG_SMALL("raw Ingenient MJPEG"),
     .priv_data_size = sizeof(FFRawVideoDemuxerContext),
     .read_header    = ff_raw_video_read_header,
     .read_packet    = ingenient_read_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "cgi", // FIXME
-    .value = CODEC_ID_MJPEG,
-    .priv_class = &ff_rawvideo_demuxer_class,
+    .flags          = AVFMT_GENERIC_INDEX,
+    .extensions     = "cgi", // FIXME
+    .raw_codec_id   = AV_CODEC_ID_MJPEG,
+    .priv_class     = &ingenient_demuxer_class,
 };