* [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init
@ 2023-10-07 0:37 Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions Andreas Rheinhardt
` (7 more replies)
0 siblings, 8 replies; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 0:37 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
And stop setting picture_number which was only done to not parse
extradata multiple times.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/wmv2dec.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 469b2c4b2b..934bf56b1a 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -203,12 +203,8 @@ static int decode_ext_header(WMV2DecContext *w)
int ff_wmv2_decode_picture_header(MpegEncContext *s)
{
- WMV2DecContext *const w = (WMV2DecContext *) s;
int code;
- if (s->picture_number == 0)
- decode_ext_header(w);
-
s->pict_type = get_bits1(&s->gb) + 1;
if (s->pict_type == AV_PICTURE_TYPE_I) {
code = get_bits(&s->gb, 7);
@@ -333,7 +329,6 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
}
s->esc3_level_length = 0;
s->esc3_run_length = 0;
- s->picture_number++; // FIXME ?
if (w->j_type) {
ff_intrax8_decode_picture(&w->x8, &s->current_picture,
@@ -578,6 +573,8 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
ff_wmv2_common_init(s);
+ decode_ext_header(w);
+
return ff_intrax8_common_init(avctx, &w->x8,
w->s.block, w->s.block_last_index,
w->s.mb_width, w->s.mb_height);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
@ 2023-10-07 0:40 ` Andreas Rheinhardt
2023-10-07 20:34 ` Michael Niedermayer
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 3/7] avcodec/h261dec: Don't set write-only picture_number Andreas Rheinhardt
` (6 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 0:40 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
They are generally set in ff_mpv_init_context_frame()
(mostly called by ff_mpv_common_init()); setting them
somewhere else should be avoided.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h261dec.c | 6 ------
libavcodec/vc1dec.c | 3 ---
2 files changed, 9 deletions(-)
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 447e168c4f..a4e0bf9cf2 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -530,17 +530,11 @@ static int h261_decode_picture_header(H261DecContext *h)
if (format == 0) { // QCIF
s->width = 176;
s->height = 144;
- s->mb_width = 11;
- s->mb_height = 9;
} else { // CIF
s->width = 352;
s->height = 288;
- s->mb_width = 22;
- s->mb_height = 18;
}
- s->mb_num = s->mb_width * s->mb_height;
-
skip_bits1(&s->gb); /* still image mode off */
skip_bits1(&s->gb); /* Reserved */
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 534128d6ee..58a50f085d 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -741,9 +741,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if (v->matrix_coef == 1 || v->matrix_coef == 6 || v->matrix_coef == 7)
avctx->colorspace = v->matrix_coef;
- s->mb_width = (avctx->coded_width + 15) >> 4;
- s->mb_height = (avctx->coded_height + 15) >> 4;
-
if (v->profile == PROFILE_ADVANCED || v->res_fasttx) {
ff_vc1_init_transposed_scantables(v);
} else {
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH 3/7] avcodec/h261dec: Don't set write-only picture_number
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions Andreas Rheinhardt
@ 2023-10-07 0:40 ` Andreas Rheinhardt
2023-10-11 19:48 ` Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 4/7] avcodec/h261dec: Remove pointless goto Andreas Rheinhardt
` (5 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 0:40 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h261dec.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index a4e0bf9cf2..91d555a70e 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -512,10 +512,7 @@ static int h261_decode_picture_header(H261DecContext *h)
}
/* temporal reference */
- i = get_bits(&s->gb, 5); /* picture timestamp */
- if (i < (s->picture_number & 31))
- i += 32;
- s->picture_number = (s->picture_number & ~31) + i;
+ skip_bits(&s->gb, 5); /* picture timestamp */
s->avctx->framerate = (AVRational) { 30000, 1001 };
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH 4/7] avcodec/h261dec: Remove pointless goto
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 3/7] avcodec/h261dec: Don't set write-only picture_number Andreas Rheinhardt
@ 2023-10-07 0:40 ` Andreas Rheinhardt
2023-10-08 16:40 ` Michael Niedermayer
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 5/7] fftools/ffmpeg_demux: Don't use fake object with av_opt_eval Andreas Rheinhardt
` (4 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 0:40 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
There is no need to parse the header twice; doing so does nothing.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h261dec.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 91d555a70e..272bbbea34 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -605,7 +605,6 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
h->gob_start_code_skipped = 0;
-retry:
init_get_bits(&s->gb, buf, buf_size * 8);
ret = h261_decode_picture_header(h);
@@ -627,8 +626,6 @@ retry:
ret = ff_set_dimensions(avctx, s->width, s->height);
if (ret < 0)
return ret;
-
- goto retry;
}
if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH 5/7] fftools/ffmpeg_demux: Don't use fake object with av_opt_eval
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
` (2 preceding siblings ...)
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 4/7] avcodec/h261dec: Remove pointless goto Andreas Rheinhardt
@ 2023-10-07 0:40 ` Andreas Rheinhardt
2023-10-10 11:48 ` Anton Khirnov
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_demux: Fix leak on error Andreas Rheinhardt
` (3 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 0:40 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The av_opt_eval family of functions emits errors messages on error
and can therefore not be used with fake objects when the AVClass
has a custom item_name callback. The AVClass for AVCodecContext
has such a custom callback (it searches whether an AVCodec is set
to use its name). In practice it means that whatever is directly
after the "cc" pointer to the AVClass for AVCodec in the stack frame
of ist_add() will be treated as a pointer to an AVCodec with
unpredictable consequences.
Fix this by using an actual AVCodecContext instead of a fake object.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
fftools/ffmpeg_demux.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index c71edf01a5..41fcb678c6 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -1042,9 +1042,6 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
char *codec_tag = NULL;
char *next;
char *discard_str = NULL;
- const AVClass *cc = avcodec_get_class();
- const AVOption *discard_opt = av_opt_find(&cc, "skip_frame", NULL,
- 0, AV_OPT_SEARCH_FAKE_OBJ);
int ret;
ds = demux_stream_alloc(d, st);
@@ -1176,18 +1173,20 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
(o->data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA))
ist->user_set_discard = AVDISCARD_ALL;
+ ist->dec_ctx = avcodec_alloc_context3(ist->dec);
+ if (!ist->dec_ctx)
+ return AVERROR(ENOMEM);
+
if (discard_str) {
- ret = av_opt_eval_int(&cc, discard_opt, discard_str, &ist->user_set_discard);
+ const AVOption *discard_opt = av_opt_find(ist->dec_ctx, "skip_frame",
+ NULL, 0, 0);
+ ret = av_opt_eval_int(ist->dec_ctx, discard_opt, discard_str, &ist->user_set_discard);
if (ret < 0) {
av_log(ist, AV_LOG_ERROR, "Error parsing discard %s.\n", discard_str);
return ret;
}
}
- ist->dec_ctx = avcodec_alloc_context3(ist->dec);
- if (!ist->dec_ctx)
- return AVERROR(ENOMEM);
-
ret = avcodec_parameters_to_context(ist->dec_ctx, par);
if (ret < 0) {
av_log(ist, AV_LOG_ERROR, "Error initializing the decoder context.\n");
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_demux: Fix leak on error
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
` (3 preceding siblings ...)
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 5/7] fftools/ffmpeg_demux: Don't use fake object with av_opt_eval Andreas Rheinhardt
@ 2023-10-07 0:40 ` Andreas Rheinhardt
2023-10-10 11:51 ` Anton Khirnov
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 7/7] avcodec/h261dec: Discard whole packet when discarding Andreas Rheinhardt
` (2 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 0:40 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
An AVFormatContext leaks on errors that happen before it is attached
to its permanent place (an InputFile). Fix this by attaching
it earlier.
Given that it is not documented that avformat_close_input() is usable
with an AVFormatContext that has only been allocated with
avformat_alloc_context() and not opened with avformat_open_input(),
one error path before avformat_open_input() had to be treated
specially: It uses avformat_free_context().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
fftools/ffmpeg_demux.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 41fcb678c6..350f233ab7 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -1462,8 +1462,10 @@ int ifile_open(const OptionsContext *o, const char *filename)
if (data_codec_name)
ret = err_merge(ret, find_codec(NULL, data_codec_name , AVMEDIA_TYPE_DATA, 0,
&ic->data_codec));
- if (ret < 0)
+ if (ret < 0) {
+ avformat_free_context(ic);
return ret;
+ }
ic->video_codec_id = video_codec_name ? ic->video_codec->id : AV_CODEC_ID_NONE;
ic->audio_codec_id = audio_codec_name ? ic->audio_codec->id : AV_CODEC_ID_NONE;
@@ -1488,6 +1490,7 @@ int ifile_open(const OptionsContext *o, const char *filename)
av_log(d, AV_LOG_ERROR, "Did you mean file:%s?\n", filename);
return err;
}
+ f->ctx = ic;
av_strlcat(d->log_name, "/", sizeof(d->log_name));
av_strlcat(d->log_name, ic->iformat->name, sizeof(d->log_name));
@@ -1527,10 +1530,8 @@ int ifile_open(const OptionsContext *o, const char *filename)
if (ret < 0) {
av_log(d, AV_LOG_FATAL, "could not find codec parameters\n");
- if (ic->nb_streams == 0) {
- avformat_close_input(&ic);
+ if (ic->nb_streams == 0)
return ret;
- }
}
}
@@ -1582,7 +1583,6 @@ int ifile_open(const OptionsContext *o, const char *filename)
}
}
- f->ctx = ic;
f->start_time = start_time;
f->recording_time = recording_time;
f->input_sync_ref = o->input_sync_ref;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH 7/7] avcodec/h261dec: Discard whole packet when discarding
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
` (4 preceding siblings ...)
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_demux: Fix leak on error Andreas Rheinhardt
@ 2023-10-07 0:40 ` Andreas Rheinhardt
2023-10-07 10:16 ` [FFmpeg-devel] [PATCH 8/8] avcodec/mpeg4video_parser: Don't set write-only current_picture_ptr Andreas Rheinhardt
2023-10-08 16:45 ` [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Michael Niedermayer
7 siblings, 0 replies; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 0:40 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
(The return value doesn't really matter: For video decoders
every return value >= 0 is treated as "consumed all of the input".)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h261dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 272bbbea34..8a823793e5 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -631,7 +631,7 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
avctx->skip_frame >= AVDISCARD_ALL)
- return get_consumed_bytes(s, buf_size);
+ return buf_size;
if (ff_mpv_frame_start(s, avctx) < 0)
return -1;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH 8/8] avcodec/mpeg4video_parser: Don't set write-only current_picture_ptr
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
` (5 preceding siblings ...)
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 7/7] avcodec/h261dec: Discard whole packet when discarding Andreas Rheinhardt
@ 2023-10-07 10:16 ` Andreas Rheinhardt
2023-10-08 16:45 ` [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Michael Niedermayer
7 siblings, 0 replies; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-07 10:16 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is unused by ff_mpeg4_decode_picture_header() (unsurprisingly given
that when decoding this function is called before the context has been
initialized).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mpeg4video_parser.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index 28353aa146..402594e01d 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -89,7 +89,6 @@ static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx,
int ret;
s->avctx = avctx;
- s->current_picture_ptr = &s->current_picture;
if (avctx->extradata_size && pc->first_picture) {
init_get_bits(gb, avctx->extradata, avctx->extradata_size * 8);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions Andreas Rheinhardt
@ 2023-10-07 20:34 ` Michael Niedermayer
2023-10-14 20:05 ` Andreas Rheinhardt
0 siblings, 1 reply; 15+ messages in thread
From: Michael Niedermayer @ 2023-10-07 20:34 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 775 bytes --]
On Sat, Oct 07, 2023 at 02:40:26AM +0200, Andreas Rheinhardt wrote:
> They are generally set in ff_mpv_init_context_frame()
> (mostly called by ff_mpv_common_init()); setting them
> somewhere else should be avoided.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/h261dec.c | 6 ------
> libavcodec/vc1dec.c | 3 ---
> 2 files changed, 9 deletions(-)
This seems to break several vc1 files like
vlcticket/5887/Cruise\ 2012_07_29_19_02_16.wmv
I think its there:
https://streams.videolan.org/issues/5887/
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH 4/7] avcodec/h261dec: Remove pointless goto
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 4/7] avcodec/h261dec: Remove pointless goto Andreas Rheinhardt
@ 2023-10-08 16:40 ` Michael Niedermayer
0 siblings, 0 replies; 15+ messages in thread
From: Michael Niedermayer @ 2023-10-08 16:40 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1250 bytes --]
On Sat, Oct 07, 2023 at 02:40:28AM +0200, Andreas Rheinhardt wrote:
> There is no need to parse the header twice; doing so does nothing.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/h261dec.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
> index 91d555a70e..272bbbea34 100644
> --- a/libavcodec/h261dec.c
> +++ b/libavcodec/h261dec.c
> @@ -605,7 +605,6 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
>
> h->gob_start_code_skipped = 0;
>
> -retry:
> init_get_bits(&s->gb, buf, buf_size * 8);
>
> ret = h261_decode_picture_header(h);
> @@ -627,8 +626,6 @@ retry:
> ret = ff_set_dimensions(avctx, s->width, s->height);
> if (ret < 0)
> return ret;
> -
> - goto retry;
the goto is not pointless, it has a semicolon which includes a point
sorry i could not resist
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
` (6 preceding siblings ...)
2023-10-07 10:16 ` [FFmpeg-devel] [PATCH 8/8] avcodec/mpeg4video_parser: Don't set write-only current_picture_ptr Andreas Rheinhardt
@ 2023-10-08 16:45 ` Michael Niedermayer
7 siblings, 0 replies; 15+ messages in thread
From: Michael Niedermayer @ 2023-10-08 16:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 696 bytes --]
On Sat, Oct 07, 2023 at 02:37:39AM +0200, Andreas Rheinhardt wrote:
> And stop setting picture_number which was only done to not parse
> extradata multiple times.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/wmv2dec.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
should be ok
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The real ebay dictionary, page 1
"Used only once" - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH 5/7] fftools/ffmpeg_demux: Don't use fake object with av_opt_eval
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 5/7] fftools/ffmpeg_demux: Don't use fake object with av_opt_eval Andreas Rheinhardt
@ 2023-10-10 11:48 ` Anton Khirnov
0 siblings, 0 replies; 15+ messages in thread
From: Anton Khirnov @ 2023-10-10 11:48 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
Quoting Andreas Rheinhardt (2023-10-07 02:40:29)
> The av_opt_eval family of functions emits errors messages on error
> and can therefore not be used with fake objects when the AVClass
> has a custom item_name callback. The AVClass for AVCodecContext
> has such a custom callback (it searches whether an AVCodec is set
> to use its name). In practice it means that whatever is directly
> after the "cc" pointer to the AVClass for AVCodec in the stack frame
> of ist_add() will be treated as a pointer to an AVCodec with
> unpredictable consequences.
>
> Fix this by using an actual AVCodecContext instead of a fake object.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> fftools/ffmpeg_demux.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
Ok
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_demux: Fix leak on error
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_demux: Fix leak on error Andreas Rheinhardt
@ 2023-10-10 11:51 ` Anton Khirnov
0 siblings, 0 replies; 15+ messages in thread
From: Anton Khirnov @ 2023-10-10 11:51 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
Quoting Andreas Rheinhardt (2023-10-07 02:40:30)
> An AVFormatContext leaks on errors that happen before it is attached
> to its permanent place (an InputFile). Fix this by attaching
> it earlier.
>
> Given that it is not documented that avformat_close_input() is usable
> with an AVFormatContext that has only been allocated with
> avformat_alloc_context() and not opened with avformat_open_input(),
> one error path before avformat_open_input() had to be treated
> specially: It uses avformat_free_context().
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> fftools/ffmpeg_demux.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Ok
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/7] avcodec/h261dec: Don't set write-only picture_number
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 3/7] avcodec/h261dec: Don't set write-only picture_number Andreas Rheinhardt
@ 2023-10-11 19:48 ` Andreas Rheinhardt
0 siblings, 0 replies; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-11 19:48 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/h261dec.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
> index a4e0bf9cf2..91d555a70e 100644
> --- a/libavcodec/h261dec.c
> +++ b/libavcodec/h261dec.c
> @@ -512,10 +512,7 @@ static int h261_decode_picture_header(H261DecContext *h)
> }
>
> /* temporal reference */
> - i = get_bits(&s->gb, 5); /* picture timestamp */
> - if (i < (s->picture_number & 31))
> - i += 32;
> - s->picture_number = (s->picture_number & ~31) + i;
> + skip_bits(&s->gb, 5); /* picture timestamp */
>
> s->avctx->framerate = (AVRational) { 30000, 1001 };
>
Will apply patches #3, #7 and #8 of this patchset.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions
2023-10-07 20:34 ` Michael Niedermayer
@ 2023-10-14 20:05 ` Andreas Rheinhardt
0 siblings, 0 replies; 15+ messages in thread
From: Andreas Rheinhardt @ 2023-10-14 20:05 UTC (permalink / raw)
To: ffmpeg-devel
Michael Niedermayer:
> On Sat, Oct 07, 2023 at 02:40:26AM +0200, Andreas Rheinhardt wrote:
>> They are generally set in ff_mpv_init_context_frame()
>> (mostly called by ff_mpv_common_init()); setting them
>> somewhere else should be avoided.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> libavcodec/h261dec.c | 6 ------
>> libavcodec/vc1dec.c | 3 ---
>> 2 files changed, 9 deletions(-)
>
> This seems to break several vc1 files like
> vlcticket/5887/Cruise\ 2012_07_29_19_02_16.wmv
>
> I think its there:
> https://streams.videolan.org/issues/5887/
>
Thanks for testing, much appreciated. The reason for this is line 968,
where mb_height is used before ff_mpv_common_init() is called. This
actually points to a potential bug: On frame size changes (can happen in
ff_vc1_decode_entry_point()), this line would still use the old value of
mb_height. But I don't want to deal with this at the moment, so I'll
simply drop the vc1dec.c stuff from this patch and apply only h261dec.c.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2023-10-14 20:04 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-07 0:37 [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions Andreas Rheinhardt
2023-10-07 20:34 ` Michael Niedermayer
2023-10-14 20:05 ` Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 3/7] avcodec/h261dec: Don't set write-only picture_number Andreas Rheinhardt
2023-10-11 19:48 ` Andreas Rheinhardt
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 4/7] avcodec/h261dec: Remove pointless goto Andreas Rheinhardt
2023-10-08 16:40 ` Michael Niedermayer
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 5/7] fftools/ffmpeg_demux: Don't use fake object with av_opt_eval Andreas Rheinhardt
2023-10-10 11:48 ` Anton Khirnov
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_demux: Fix leak on error Andreas Rheinhardt
2023-10-10 11:51 ` Anton Khirnov
2023-10-07 0:40 ` [FFmpeg-devel] [PATCH 7/7] avcodec/h261dec: Discard whole packet when discarding Andreas Rheinhardt
2023-10-07 10:16 ` [FFmpeg-devel] [PATCH 8/8] avcodec/mpeg4video_parser: Don't set write-only current_picture_ptr Andreas Rheinhardt
2023-10-08 16:45 ` [FFmpeg-devel] [PATCH 1/7] avcodec/wmv2dec: Parse extradata during init Michael Niedermayer
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git