Browse Source

set bits_per_coded_sample according to new lavc api

Originally committed as revision 15289 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Baptiste Coudurier 16 years ago
parent
commit
00adc1e5dc
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      libavdevice/vfwcap.c
  2. +3
    -3
      libavformat/avisynth.c

+ 1
- 1
libavdevice/vfwcap.c View File

@@ -370,7 +370,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->codec_id = CODEC_ID_RAWVIDEO; codec->codec_id = CODEC_ID_RAWVIDEO;
codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount); codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount);
if(biCompression == BI_RGB) if(biCompression == BI_RGB)
codec->bits_per_sample = biBitCount;
codec->bits_per_coded_sample = biBitCount;


av_set_pts_info(st, 32, 1, 1000); av_set_pts_info(st, 32, 1, 1000);




+ 3
- 3
libavformat/avisynth.c View File

@@ -91,13 +91,13 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->channels = wvfmt.nChannels; st->codec->channels = wvfmt.nChannels;
st->codec->sample_rate = wvfmt.nSamplesPerSec; st->codec->sample_rate = wvfmt.nSamplesPerSec;
st->codec->bit_rate = wvfmt.nAvgBytesPerSec * 8; 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_samples = wvfmt.nSamplesPerSec * (uint64_t)info.dwScale / (uint64_t)info.dwRate;
stream->chunck_size = stream->chunck_samples * wvfmt.nChannels * wvfmt.wBitsPerSample / 8; stream->chunck_size = stream->chunck_samples * wvfmt.nChannels * wvfmt.wBitsPerSample / 8;


st->codec->codec_tag = wvfmt.wFormatTag; 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 = wav_codec_get_id(wvfmt.wFormatTag, st->codec->bits_per_coded_sample);
} }
else if (stream->info.fccType == streamtypeVIDEO) else if (stream->info.fccType == streamtypeVIDEO)
{ {
@@ -118,7 +118,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->width = imgfmt.bmiHeader.biWidth; st->codec->width = imgfmt.bmiHeader.biWidth;
st->codec->height = imgfmt.bmiHeader.biHeight; 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->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_tag = imgfmt.bmiHeader.biCompression;
st->codec->codec_id = codec_get_id(codec_bmp_tags, imgfmt.bmiHeader.biCompression); st->codec->codec_id = codec_get_id(codec_bmp_tags, imgfmt.bmiHeader.biCompression);


Loading…
Cancel
Save