rawdec: make use of AV_OPT_TYPE_VIDEO_RATE
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
3d9a789b0d
commit
4c76600a8c
@ -70,7 +70,6 @@ int ff_raw_video_read_header(AVFormatContext *s)
|
|||||||
{
|
{
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
FFRawVideoDemuxerContext *s1 = s->priv_data;
|
FFRawVideoDemuxerContext *s1 = s->priv_data;
|
||||||
AVRational framerate;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
|
||||||
@ -84,12 +83,7 @@ int ff_raw_video_read_header(AVFormatContext *s)
|
|||||||
st->codec->codec_id = s->iformat->raw_codec_id;
|
st->codec->codec_id = s->iformat->raw_codec_id;
|
||||||
st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
|
st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
|
||||||
|
|
||||||
if ((ret = av_parse_video_rate(&framerate, s1->framerate)) < 0) {
|
st->codec->time_base = av_inv_q(s1->framerate);
|
||||||
av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
st->codec->time_base = av_inv_q(framerate);
|
|
||||||
avpriv_set_pts_info(st, 64, 1, 1200000);
|
avpriv_set_pts_info(st, 64, 1, 1200000);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
@ -101,7 +95,7 @@ fail:
|
|||||||
#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
|
#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
|
||||||
#define DEC AV_OPT_FLAG_DECODING_PARAM
|
#define DEC AV_OPT_FLAG_DECODING_PARAM
|
||||||
const AVOption ff_rawvideo_options[] = {
|
const AVOption ff_rawvideo_options[] = {
|
||||||
{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC},
|
{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC},
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ typedef struct FFRawVideoDemuxerContext {
|
|||||||
const AVClass *class; /**< Class for private options. */
|
const AVClass *class; /**< Class for private options. */
|
||||||
char *video_size; /**< String describing video size, set by a private option. */
|
char *video_size; /**< String describing video size, set by a private option. */
|
||||||
char *pixel_format; /**< Set by a private option. */
|
char *pixel_format; /**< Set by a private option. */
|
||||||
char *framerate; /**< String describing framerate, set by a private option. */
|
AVRational framerate; /**< AVRational describing framerate, set by a private option. */
|
||||||
} FFRawVideoDemuxerContext;
|
} FFRawVideoDemuxerContext;
|
||||||
|
|
||||||
extern const AVOption ff_rawvideo_options[];
|
extern const AVOption ff_rawvideo_options[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user