summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12enc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-09-13 23:45:24 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2016-01-21 15:33:19 -0500
commitd749615333084e62c9fcc480d1ae466369fdf14f (patch)
tree138289453dccd27de000c2f27622148245f8eb83 /libavcodec/mpeg12enc.c
parent96c373c7704aeb1cc1d2c275fbb5d71777665589 (diff)
lavc: Move timecode_frame_start to codec private options
This option is only used by mpeg2. It is a very codec-specific option, so deprecate the global variant. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r--libavcodec/mpeg12enc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 61716785a1..67bc467f5b 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -182,6 +182,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
return -1;
}
+#if FF_API_PRIVATE_OPT
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (avctx->timecode_frame_start)
+ s->timecode_frame_start = avctx->timecode_frame_start;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
return 0;
}
@@ -307,7 +314,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
* fake MPEG frame rate in case of low frame rate */
fps = (framerate.num + framerate.den / 2) / framerate.den;
time_code = s->current_picture_ptr->f->coded_picture_number +
- s->avctx->timecode_frame_start;
+ s->timecode_frame_start;
s->gop_picture_number = s->current_picture_ptr->f->coded_picture_number;
if (s->drop_frame_timecode) {
@@ -1050,7 +1057,9 @@ av_cold void ff_mpeg1_encode_init(MpegEncContext *s)
{ "drop_frame_timecode", "Timecode is in drop frame format.", \
OFFSET(drop_frame_timecode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \
{ "scan_offset", "Reserve space for SVCD scan offset user data.", \
- OFFSET(scan_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ OFFSET(scan_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \
+ { "timecode_frame_start", "GOP timecode frame start number, in non-drop-frame format", \
+ OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, VE}, \
static const AVOption mpeg1_options[] = {
COMMON_OPTS