aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dvdvideodec.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/dvdvideodec: Fix incorrect padding cell trim logicMarth642024-07-131-9/+9
| | | | | | | | | | | | | | | | | | | When -trim option is used (by default), padding cells at the beginning of the title are supposed to be ignored. The current implementation does the ignoring after we have locked on to the PGC navigation event stream, but does not set the PGC/PG state properly. This causes false positives and errors on some discs due to a search for a program stream cell that never succeeds. User would have to know to disable the -trim option to work around the issue. Simplify the logic and move it to the NAV packet event handling, in turn implementing the behaviour correctly and fixing the trim function for impacted discs. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: Remove redundant ret initializationsMarth642024-07-131-6/+6
| | | | | | | | Remove initializing ret = 0, in areas where ret is only used to hold an error value, immediately returned, and the function would otherwise return a literal 0. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: Don't add chapter markers for empty/dummy PTTsMarth642024-07-131-5/+11
| | | | | | | | | | Some discs (usually same ones with padding cells), also have empty padding PTTs / chapters to accompany them. This results, for example, in an extra chapter marker that starts and ends at 0 (no duration). Don't add these empty chapter markers. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: Remove unused cell count variableMarth642024-07-071-2/+0
| | | | | Signed-off-by: Marth64 <marth64@proxyid.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/dvdvideodec: Fix duration logic with 1 chapter and validate chapter ↵Marth642024-07-011-3/+12
| | | | | | | | | | | | | | | range Chapters and duration are calculated together in dvdvideo demuxer. Previous chapter calculation logic treated extraction of 1 chapter using chapter_start and chapter_end switches incorrectly, returning the duration of the entire title instead of just the segment. Fix the logic so that it calculates and returns the duration of the chapter segment instead. Additionally, validate that chapter_end exceeds chapter_start (except in the special case of 0). Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: Do not EOF on WAIT eventsMarth642024-07-011-9/+8
| | | | | | | | | A DVDNAV_WAIT event by itself should not warrant an EOF when navigating the program stream. Some discs have WAIT events in the middle of a title, causing playback to end prematurely prior to this fix. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: add explicit inttypes.h includeMarth642024-03-261-0/+2
| | | | | | | | | | Since log statements printing int64 were made portable in 4464b7eeb194e98ac115f18d2b6be67361407c8a, let us include inttypes.h explicitly (as it is unclear where PRId64 and such are coming from now). Reported-by: Leo Izen <leo.izen@gmail.com> Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.hAndreas Rheinhardt2024-03-261-1/+1
| | | | | | | | | and rename it to FF_INFMT_INIT_CLEANUP. This flag is demuxer-only, so this is the more appropriate place for it. This does not preclude adding internal flags common to both demuxer and muxer in the future. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: use int64_t for menu blocks_read and make format ↵Marth642024-03-151-7/+8
| | | | | | | expressions portable Signed-off-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: add menu demuxing supportMarth642024-03-121-11/+303
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: add CLUT utilities and subtitle color supportMarth642024-03-121-0/+14
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: assign mono channel layout explicitlyMarth642024-03-101-1/+3
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-071-7/+8
| | | | | | | | | | | | | | | | | | | | | This commit does for AVInputFormat what commit 59c9dc82f450638a3068deeb1db5c56f6d155752 did for AVOutputFormat: It adds a new type FFInputFormat, moves all the internals of AVInputFormat to it and adds a now reduced AVInputFormat as first member. This does not affect/improve extensibility of both public or private fields for demuxers (it is still a mess due to lavd). This is possible since 50f34172e0cca2cabc5836308ec66dbf93f5f2a3 (which removed the last usage of an internal field of AVInputFormat in fftools). (Hint: tools/probetest.c accesses the internals of FFInputFormat as well, but given that it is a testing tool this is not considered a problem.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: fix -pgc and -pg optionsMarth642024-03-041-10/+13
| | | | | | | | | | Rebased on top of recently merged fixes (should apply correctly now). 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>
* avformat/dvdvideodec: Reorder allocations to simplify freeingAndreas Rheinhardt2024-03-031-8/+4
| | | | | Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: Only free allocated buffersAndreas Rheinhardt2024-03-031-1/+0
| | | | | Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: Don't store AVInputFormat*Andreas Rheinhardt2024-03-031-6/+2
| | | | | | | | | | | The inner AVInputFormat* of the inner mpegps-demuxer is only used once (in avformat_open_input()), so don't even store it. In fact, just use ff_mpegps_demuxer directly, as this demuxer has a configure dependency on it. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: Explicitly return 0 on successAndreas Rheinhardt2024-03-031-9/+6
| | | | | | | Don't "return ret" even when ret is zero on success. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavformat/dvdvideo: add DVD-Video demuxer, powered by libdvdread and libdvdnavMarth642024-03-021-0/+1411
Signed-off-by: Marth64 <marth64@proxyid.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>