]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/bethsoftvid.c
restore old buffer content when seek failed in http protocol, fix issue #1631
[ffmpeg] / libavformat / bethsoftvid.c
index a69b8804533b4673bfe9631cb854b96a3d2db2a5..e599255f16910201b1d161bbceb5e70bcff4ac38 100644 (file)
  */
 
 /**
- * @file bethsoftvid.c
+ * @file libavformat/bethsoftvid.c
  * @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
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avformat.h"
 #include "libavcodec/bethsoftvideo.h"
 
@@ -89,8 +90,8 @@ static int vid_read_header(AVFormatContext *s,
     stream->codec->codec_id = CODEC_ID_PCM_U8;
     stream->codec->channels = 1;
     stream->codec->sample_rate = 11025;
-    stream->codec->bits_per_sample = 8;
-    stream->codec->bit_rate = stream->codec->channels * stream->codec->sample_rate * stream->codec->bits_per_sample;
+    stream->codec->bits_per_coded_sample = 8;
+    stream->codec->bit_rate = stream->codec->channels * stream->codec->sample_rate * stream->codec->bits_per_coded_sample;
 
     return 0;
 }
@@ -197,7 +198,7 @@ static int vid_read_packet(AVFormatContext *s,
             get_le16(pb);
             // soundblaster DAC used for sample rate, as on specification page (link above)
             s->streams[1]->codec->sample_rate = 1000000 / (256 - get_byte(pb));
-            s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_sample;
+            s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_coded_sample;
         case AUDIO_BLOCK:
             audio_length = get_le16(pb);
             ret_value = av_get_packet(pb, pkt, audio_length);
@@ -225,7 +226,7 @@ static int vid_read_packet(AVFormatContext *s,
 
 AVInputFormat bethsoftvid_demuxer = {
     "bethsoftvid",
-    "Bethesda Softworks 'Daggerfall' VID format",
+    NULL_IF_CONFIG_SMALL("Bethesda Softworks VID format"),
     sizeof(BVID_DemuxContext),
     vid_probe,
     vid_read_header,