The branch, release/7.1 has been updated
via 8def1608e402a8e08a0d8a34d30e4193c935ed66 (commit)
via 31ec50c8b33c5c99649ffc986b4e60c15a038080 (commit)
from 84bcf54e92d10982e8635fd6818c5bac49d83410 (commit)
- Log -----------------------------------------------------------------
commit 8def1608e402a8e08a0d8a34d30e4193c935ed66
Author: James Almer <[email protected]>
AuthorDate: Mon Aug 18 12:22:09 2025 -0300
Commit: James Almer <[email protected]>
CommitDate: Wed Sep 10 09:31:58 2025 -0300
fftools/ffmpeg_demux: ensure the display_rotation option is honored
If requested, it should have priotity over any coded value.
Fixes ticket #11649.
Signed-off-by: James Almer <[email protected]>
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index d44dce1119..7d87422eee 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -67,6 +67,7 @@ typedef struct DemuxStream {
int reinit_filters;
int autorotate;
int apply_cropping;
+ int force_display_matrix;
int wrap_correction_done;
@@ -1168,6 +1169,7 @@ static int add_display_matrix_to_stream(const
OptionsContext *o,
AVFormatContext *ctx, InputStream *ist)
{
AVStream *st = ist->st;
+ DemuxStream *ds = ds_from_ist(ist);
AVPacketSideData *sd;
double rotation = DBL_MAX;
int hflip = -1, vflip = -1;
@@ -1202,6 +1204,8 @@ static int add_display_matrix_to_stream(const
OptionsContext *o,
hflip_set ? hflip : 0,
vflip_set ? vflip : 0);
+ ds->force_display_matrix = 1;
+
return 0;
}
@@ -1429,6 +1433,15 @@ static int ist_add(const OptionsContext *o, Demuxer *d,
AVStream *st, AVDictiona
av_dict_set_int(&ds->decoder_opts, "apply_cropping",
ds->apply_cropping && ds->apply_cropping !=
CROP_CONTAINER, 0);
+ if (ds->force_display_matrix) {
+ char buf[32];
+ if (av_dict_get(ds->decoder_opts, "side_data_prefer_packet", NULL, 0))
+ buf[0] = ',';
+ else
+ buf[0] = '\0';
+ av_strlcat(buf, "displaymatrix", sizeof(buf));
+ av_dict_set(&ds->decoder_opts, "side_data_prefer_packet", buf,
AV_DICT_APPEND);
+ }
/* Attached pics are sparse, therefore we would not want to delay their
decoding
* till EOF. */
if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)
commit 31ec50c8b33c5c99649ffc986b4e60c15a038080
Author: James Almer <[email protected]>
AuthorDate: Wed Sep 10 09:31:48 2025 -0300
Commit: James Almer <[email protected]>
CommitDate: Wed Sep 10 09:31:58 2025 -0300
avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix
Otherwise, the user requested priority of packet side data will be ignored.
Signed-off-by: James Almer <[email protected]>
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index ef4fc075b2..9438184ae5 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2865,15 +2865,15 @@ the_end:
AVFrameSideData *sd = NULL;
if (orientation >= 2 && orientation <= 8) {
- int32_t *matrix;
-
- sd = av_frame_new_side_data(frame,
AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9);
- if (!sd) {
+ ret = ff_frame_new_side_data(avctx, frame,
AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9, &sd);
+ if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side
data\n");
- return AVERROR(ENOMEM);
+ return ret;
}
+ }
- matrix = (int32_t *)sd->data;
+ if (sd) {
+ int32_t *matrix = (int32_t *)sd->data;
switch (orientation) {
case 2:
-----------------------------------------------------------------------
Summary of changes:
fftools/ffmpeg_demux.c | 13 +++++++++++++
libavcodec/mjpegdec.c | 12 ++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]