]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avisynth.c
Support Etymonix MPEG-2 video codec, fixes issue 1603.
[ffmpeg] / libavformat / avisynth.c
index 1afcdea5e671396d7e3896a3964a4a5d3f40753d..7ca52d98928b4ad8dd57f0dcb28ed2acedfc6668 100644 (file)
@@ -91,13 +91,13 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
                   st->codec->channels = wvfmt.nChannels;
                   st->codec->sample_rate = wvfmt.nSamplesPerSec;
                   st->codec->bit_rate = wvfmt.nAvgBytesPerSec * 8;
-                  st->codec->bits_per_sample = wvfmt.wBitsPerSample;
+                  st->codec->bits_per_coded_sample = wvfmt.wBitsPerSample;
 
                   stream->chunck_samples = wvfmt.nSamplesPerSec * (uint64_t)info.dwScale / (uint64_t)info.dwRate;
                   stream->chunck_size = stream->chunck_samples * wvfmt.nChannels * wvfmt.wBitsPerSample / 8;
 
                   st->codec->codec_tag = wvfmt.wFormatTag;
-                  st->codec->codec_id = wav_codec_get_id(wvfmt.wFormatTag, st->codec->bits_per_sample);
+                  st->codec->codec_id = ff_wav_codec_get_id(wvfmt.wFormatTag, st->codec->bits_per_coded_sample);
                 }
               else if (stream->info.fccType == streamtypeVIDEO)
                 {
@@ -118,10 +118,10 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
                   st->codec->width = imgfmt.bmiHeader.biWidth;
                   st->codec->height = imgfmt.bmiHeader.biHeight;
 
-                  st->codec->bits_per_sample = imgfmt.bmiHeader.biBitCount;
+                  st->codec->bits_per_coded_sample = imgfmt.bmiHeader.biBitCount;
                   st->codec->bit_rate = (uint64_t)stream->info.dwSampleSize * (uint64_t)stream->info.dwRate * 8 / (uint64_t)stream->info.dwScale;
                   st->codec->codec_tag = imgfmt.bmiHeader.biCompression;
-                  st->codec->codec_id = codec_get_id(codec_bmp_tags, imgfmt.bmiHeader.biCompression);
+                  st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, imgfmt.bmiHeader.biCompression);
 
                   st->duration = stream->info.dwLength;
                 }
@@ -156,10 +156,10 @@ static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt)
   stream = &avs->streams[stream_id];
 
   if (stream->read >= stream->info.dwLength)
-    return AVERROR_IO;
+    return AVERROR(EIO);
 
   if (av_new_packet(pkt, stream->chunck_size))
-    return AVERROR_IO;
+    return AVERROR(EIO);
   pkt->stream_index = stream_id;
   pkt->pts = avs->streams[stream_id].read / avs->streams[stream_id].chunck_samples;
 
@@ -209,7 +209,7 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index, int64_t pts,
 
 AVInputFormat avisynth_demuxer = {
   "avs",
-  "AVISynth",
+  NULL_IF_CONFIG_SMALL("AVISynth"),
   sizeof(AVISynthContext),
   NULL,
   avisynth_read_header,