avformat/oggenc: Schedule pagesize option for removal

Deprecated in 59220d559b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2025-11-21 15:52:46 +01:00 committed by James Almer
parent 191f7e4869
commit 775b102182
1 changed files with 11 additions and 6 deletions

View File

@ -76,7 +76,9 @@ typedef struct OGGPageList {
typedef struct OGGContext {
const AVClass *class;
OGGPageList *page_list;
#if LIBAVFORMAT_VERSION_MAJOR < 63
int pref_size; ///< preferred page size (0 => fill all segments)
#endif
int64_t pref_duration; ///< preferred page duration (0 => fill all segments)
int serial_offset;
} OGGContext;
@ -87,10 +89,12 @@ typedef struct OGGContext {
static const AVOption options[] = {
{ "serial_offset", "serial number offset",
OFFSET(serial_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, PARAM },
#if LIBAVFORMAT_VERSION_MAJOR < 63
{ "oggpagesize", "Set preferred Ogg page size.",
OFFSET(pref_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, MAX_PAGE_SIZE, PARAM},
{ "pagesize", "preferred page size in bytes (deprecated)",
OFFSET(pref_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_PAGE_SIZE, PARAM },
OFFSET(pref_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, MAX_PAGE_SIZE, PARAM | AV_OPT_FLAG_DEPRECATED },
{ "pagesize", "preferred page size in bytes",
OFFSET(pref_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_PAGE_SIZE, PARAM | AV_OPT_FLAG_DEPRECATED },
#endif
{ "page_duration", "preferred page duration, in microseconds",
OFFSET(pref_duration), AV_OPT_TYPE_INT64, { .i64 = 1000000 }, 0, INT64_MAX, PARAM },
{ NULL },
@ -262,8 +266,12 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
if (page->segments_count == 255) {
ogg_buffer_page(s, oggstream);
} else if (!header) {
#if LIBAVFORMAT_VERSION_MAJOR < 63
if ((ogg->pref_size > 0 && page->size >= ogg->pref_size) ||
(ogg->pref_duration > 0 && next - start >= ogg->pref_duration)) {
#else
if (ogg->pref_duration > 0 && next - start >= ogg->pref_duration) {
#endif
ogg_buffer_page(s, oggstream);
}
}
@ -477,9 +485,6 @@ static int ogg_init(AVFormatContext *s)
OGGStreamContext *oggstream = NULL;
int i, j;
if (ogg->pref_size)
av_log(s, AV_LOG_WARNING, "The pagesize option is deprecated\n");
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
unsigned serial_num = i + ogg->serial_offset;