diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2012-02-03 14:55:20 -0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-03 18:12:29 +0100 |
commit | 1f0fa80bfa7a0a2ee455679510761f7e138444ae (patch) | |
tree | ac9572c9415e08a47aae989bccc86d2494c153ce /libavdevice/dshow.c | |
parent | c9e5acad611c77db5f37299a4a50f15922d85a4c (diff) | |
download | ffmpeg-streaming-1f0fa80bfa7a0a2ee455679510761f7e138444ae.zip ffmpeg-streaming-1f0fa80bfa7a0a2ee455679510761f7e138444ae.tar.gz |
dshow: use DirectShow information to set time_base
Fixes build after removal of AVFormatParameters.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/dshow.c')
-rw-r--r-- | libavdevice/dshow.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 2704834..21e275d 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -683,12 +683,15 @@ dshow_add_device(AVFormatContext *avctx, codec = st->codec; if (devtype == VideoDevice) { BITMAPINFOHEADER *bih = NULL; + AVRational time_base; if (IsEqualGUID(&type.formattype, &FORMAT_VideoInfo)) { VIDEOINFOHEADER *v = (void *) type.pbFormat; + time_base = (AVRational) { v->AvgTimePerFrame, 10000000 }; bih = &v->bmiHeader; } else if (IsEqualGUID(&type.formattype, &FORMAT_VideoInfo2)) { VIDEOINFOHEADER2 *v = (void *) type.pbFormat; + time_base = (AVRational) { v->AvgTimePerFrame, 10000000 }; bih = &v->bmiHeader; } if (!bih) { @@ -696,7 +699,7 @@ dshow_add_device(AVFormatContext *avctx, goto error; } - codec->time_base = ap->time_base; + codec->time_base = time_base; codec->codec_type = AVMEDIA_TYPE_VIDEO; codec->width = bih->biWidth; codec->height = bih->biHeight; @@ -851,7 +854,7 @@ static int dshow_read_header(AVFormatContext *avctx) ret = dshow_open_device(avctx, devenum, VideoDevice); if (ret < 0) goto error; - ret = dshow_add_device(avctx, ap, VideoDevice); + ret = dshow_add_device(avctx, VideoDevice); if (ret < 0) goto error; } @@ -859,7 +862,7 @@ static int dshow_read_header(AVFormatContext *avctx) ret = dshow_open_device(avctx, devenum, AudioDevice); if (ret < 0) goto error; - ret = dshow_add_device(avctx, ap, AudioDevice); + ret = dshow_add_device(avctx, AudioDevice); if (ret < 0) goto error; } |