]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/bethsoftvid.c
mtv: Make sure audio_subsegments is not 0
[ffmpeg] / libavformat / bethsoftvid.c
index 01e6f55cd4f9f2ee8e0bc4525a3d89d3cfb31419..7705fcb5f644f4f0de49124037702897e20f10e2 100644 (file)
  * @file
  * @brief Bethesda Softworks VID (.vid) file demuxer
  * @author Nicholas Tung [ntung (at. ntung com] (2007-03)
- * @sa http://wiki.multimedia.cx/index.php?title=Bethsoft_VID
- * @sa http://www.svatopluk.com/andux/docs/dfvid.html
+ * @see http://wiki.multimedia.cx/index.php?title=Bethsoft_VID
+ * @see http://www.svatopluk.com/andux/docs/dfvid.html
  */
 
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
+#include "internal.h"
 #include "libavcodec/bethsoftvideo.h"
 
 typedef struct BVID_DemuxContext
@@ -70,10 +71,10 @@ static int vid_read_header(AVFormatContext *s,
     avio_skip(pb, 5);
     vid->nframes = avio_rl16(pb);
 
-    stream = av_new_stream(s, 0);
+    stream = avformat_new_stream(s, NULL);
     if (!stream)
         return AVERROR(ENOMEM);
-    av_set_pts_info(stream, 32, 1, 60);     // 16 ms increments, i.e. 60 fps
+    avpriv_set_pts_info(stream, 32, 1, 60);     // 16 ms increments, i.e. 60 fps
     stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     stream->codec->codec_id = CODEC_ID_BETHSOFTVID;
     stream->codec->width = avio_rl16(pb);
@@ -83,7 +84,7 @@ static int vid_read_header(AVFormatContext *s,
     avio_rl16(pb);
 
     // done with video codec, set up audio codec
-    stream = av_new_stream(s, 0);
+    stream = avformat_new_stream(s, NULL);
     if (!stream)
         return AVERROR(ENOMEM);
     stream->codec->codec_type = AVMEDIA_TYPE_AUDIO;
@@ -220,15 +221,13 @@ static int vid_read_packet(AVFormatContext *s,
             av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
                    block_type, block_type, block_type); return -1;
     }
-
-    return 0;
 }
 
 AVInputFormat ff_bethsoftvid_demuxer = {
-    "bethsoftvid",
-    NULL_IF_CONFIG_SMALL("Bethesda Softworks VID format"),
-    sizeof(BVID_DemuxContext),
-    vid_probe,
-    vid_read_header,
-    vid_read_packet,
+    .name           = "bethsoftvid",
+    .long_name      = NULL_IF_CONFIG_SMALL("Bethesda Softworks VID format"),
+    .priv_data_size = sizeof(BVID_DemuxContext),
+    .read_probe     = vid_probe,
+    .read_header    = vid_read_header,
+    .read_packet    = vid_read_packet,
 };