Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/dvdvideodec: fix -pgc and -pg options
@ 2024-03-03  2:29 Marth64
  2024-03-04  9:24 ` Stefano Sabatini
  0 siblings, 1 reply; 4+ messages in thread
From: Marth64 @ 2024-03-03  2:29 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Marth64

In merged DVD patch, -pgc and -pg options were broken. While these are
rather advanced options, they are the only means to get content for
some strangely authored discs.

Signed-off-by: Marth64 <marth64@proxyid.net>
---
 libavformat/dvdvideodec.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c
index 3355010356..d53aef07ff 100644
--- a/libavformat/dvdvideodec.c
+++ b/libavformat/dvdvideodec.c
@@ -508,11 +508,12 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState
                                         state->celln, e_cell->cellN, is_cell_promising);
 
                 if (!state->in_ps && !state->in_pgc) {
-                    if (cur_title == c->opt_title       &&
-                        cur_ptt == c->opt_chapter_start &&
-                        cur_pgcn == state->pgcn         &&
-                        cur_pgn == state->entry_pgn     &&
+                    if (cur_title == c->opt_title                        &&
+                        (c->opt_pgc || cur_ptt == c->opt_chapter_start)  &&
+                        cur_pgcn == state->pgcn                          &&
+                        cur_pgn == state->entry_pgn                      &&
                         is_cell_promising) {
+
                         state->in_pgc = 1;
                     }
 
@@ -1266,19 +1267,21 @@ static int dvdvideo_read_header(AVFormatContext *s)
     }
 
     if (c->opt_pgc) {
-        if (c->opt_pg == 0)
+        if (c->opt_pg == 0) {
             av_log(s, AV_LOG_ERROR, "Invalid coordinates. If -pgc is set, -pg must be set too.\n");
-        else if (c->opt_chapter_start > 1 || c->opt_chapter_end > 0 || c->opt_preindex)
+
+            return AVERROR(EINVAL);
+        } else if (c->opt_chapter_start > 1 || c->opt_chapter_end > 0 || c->opt_preindex) {
             av_log(s, AV_LOG_ERROR, "-pgc is not compatible with the -preindex or "
                                     "-chapter_start/-chapter_end options\n");
-
-        return AVERROR(EINVAL);
+            return AVERROR(EINVAL);
+        }
     }
 
     if ((ret = dvdvideo_ifo_open(s)) < 0)
         return ret;
 
-    if (c->opt_preindex && (ret = dvdvideo_chapters_setup_preindex(s)) < 0)
+    if (!c->opt_pgc && c->opt_preindex && (ret = dvdvideo_chapters_setup_preindex(s)) < 0)
         return ret;
 
     if ((ret = dvdvideo_play_open(s, &c->play_state)) < 0   ||
@@ -1288,7 +1291,7 @@ static int dvdvideo_read_header(AVFormatContext *s)
         (ret = dvdvideo_subp_stream_add_all(s)) < 0)
         return ret;
 
-    if (!c->opt_preindex)
+    if (!c->opt_pgc && !c->opt_preindex)
         return dvdvideo_chapters_setup_simple(s);
 
     return ret;
-- 
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] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/dvdvideodec: fix -pgc and -pg options
  2024-03-03  2:29 [FFmpeg-devel] [PATCH] avformat/dvdvideodec: fix -pgc and -pg options Marth64
@ 2024-03-04  9:24 ` Stefano Sabatini
  2024-03-04  9:43   ` Stefano Sabatini
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Sabatini @ 2024-03-04  9:24 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Marth64

On date Saturday 2024-03-02 20:29:13 -0600, Marth64 wrote:
> In merged DVD patch, -pgc and -pg options were broken. While these are
> rather advanced options, they are the only means to get content for
> some strangely authored discs.
> 
> Signed-off-by: Marth64 <marth64@proxyid.net>
> ---
>  libavformat/dvdvideodec.c | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)

Will apply, thanks.
_______________________________________________
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] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/dvdvideodec: fix -pgc and -pg options
  2024-03-04  9:24 ` Stefano Sabatini
@ 2024-03-04  9:43   ` Stefano Sabatini
  2024-03-04 16:37     ` Marth64
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Sabatini @ 2024-03-04  9:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches, Marth64

On date Monday 2024-03-04 10:24:42 +0100, Stefano Sabatini wrote:
> On date Saturday 2024-03-02 20:29:13 -0600, Marth64 wrote:
> > In merged DVD patch, -pgc and -pg options were broken. While these are
> > rather advanced options, they are the only means to get content for
> > some strangely authored discs.
> > 
> > Signed-off-by: Marth64 <marth64@proxyid.net>
> > ---
> >  libavformat/dvdvideodec.c | 23 +++++++++++++----------
> >  1 file changed, 13 insertions(+), 10 deletions(-)
> 
> Will apply, thanks.

Not really:
$ git am patches/0001-lavf-dvvideodec-fix-opts.patch  --reject
Applying: avformat/dvdvideodec: fix -pgc and -pg options
Checking patch libavformat/dvdvideodec.c...
Hunk #1 succeeded at 507 (offset -1 lines).
Hunk #2 succeeded at 1255 (offset -12 lines).
error: while searching for:
        (ret = dvdvideo_subp_stream_add_all(s)) < 0)
        return ret;

    if (!c->opt_preindex)
        return dvdvideo_chapters_setup_simple(s);

    return ret;

error: patch failed: libavformat/dvdvideodec.c:1288
Applying patch libavformat/dvdvideodec.c with 1 reject...
Hunk #1 applied cleanly.
Hunk #2 applied cleanly.
Rejected hunk #3.
_______________________________________________
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] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/dvdvideodec: fix -pgc and -pg options
  2024-03-04  9:43   ` Stefano Sabatini
@ 2024-03-04 16:37     ` Marth64
  0 siblings, 0 replies; 4+ messages in thread
From: Marth64 @ 2024-03-04 16:37 UTC (permalink / raw)
  To: FFmpeg development discussions and patches, Marth64

Looks like v2 made it in. All good here. Thanks, Stefano !

On Mon, Mar 4, 2024 at 3:43 AM Stefano Sabatini <stefasab@gmail.com> wrote:

> On date Monday 2024-03-04 10:24:42 +0100, Stefano Sabatini wrote:
> > On date Saturday 2024-03-02 20:29:13 -0600, Marth64 wrote:
> > > In merged DVD patch, -pgc and -pg options were broken. While these are
> > > rather advanced options, they are the only means to get content for
> > > some strangely authored discs.
> > >
> > > Signed-off-by: Marth64 <marth64@proxyid.net>
> > > ---
> > >  libavformat/dvdvideodec.c | 23 +++++++++++++----------
> > >  1 file changed, 13 insertions(+), 10 deletions(-)
> >
> > Will apply, thanks.
>
> Not really:
> $ git am patches/0001-lavf-dvvideodec-fix-opts.patch  --reject
> Applying: avformat/dvdvideodec: fix -pgc and -pg options
> Checking patch libavformat/dvdvideodec.c...
> Hunk #1 succeeded at 507 (offset -1 lines).
> Hunk #2 succeeded at 1255 (offset -12 lines).
> error: while searching for:
>         (ret = dvdvideo_subp_stream_add_all(s)) < 0)
>         return ret;
>
>     if (!c->opt_preindex)
>         return dvdvideo_chapters_setup_simple(s);
>
>     return ret;
>
> error: patch failed: libavformat/dvdvideodec.c:1288
> Applying patch libavformat/dvdvideodec.c with 1 reject...
> Hunk #1 applied cleanly.
> Hunk #2 applied cleanly.
> Rejected hunk #3.
>
_______________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2024-03-04 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-03  2:29 [FFmpeg-devel] [PATCH] avformat/dvdvideodec: fix -pgc and -pg options Marth64
2024-03-04  9:24 ` Stefano Sabatini
2024-03-04  9:43   ` Stefano Sabatini
2024-03-04 16:37     ` Marth64

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