Commit Graph

11 Commits

Author SHA1 Message Date
Andreas Rheinhardt 7ad4928580 avformat/ty: Remove write-only array and variable
Up until now, the TiVo demuxer parse an array of SEQ entries, yet it has
never ever made any use of them. In fact, parse_master, the function
parsing said table, only influenced the outside world in three ways: Via
an excessive amount of error message in case a certain parameter is not
what it expected; via an allocation (the aforementioned write-only
array); and by setting a certain parameter (ty->cur_chunk_pos), but that
parameter is always overwritten before it is used (it is overwritten
in get_chunk() on success and if get_chunk() fails, the error is
returned to the caller anyway). So remove the array and the function
used to parse it.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-11 16:44:11 +02:00
Andreas Rheinhardt c1e439d7e9 avformat: Forward errors where possible
It is not uncommon to find code where the caller thinks to know better
what the return value should be than the callee. E.g. something like
"if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit
changes several instances of this to instead forward the actual error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-12 19:25:33 +01:00
Carl Eugen Hoyos 4d8875ec23 lavf: Constify the probe function argument.
Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
2019-03-21 11:42:17 +01:00
Michael Niedermayer 8c49340b18 libavformat/ty: use decimal constant for shift
This was the only case in the source that uses a hexadecimal shift value.
The change removed a special case in respect to greping

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-10-07 03:03:09 +02:00
Paul B Mahol f38d0d0c22 avformat/ty: check cur_chunk_pos before using it
Fixes #6831.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-11-12 22:58:15 +01:00
Paul B Mahol a38b14a432 avformat/ty: fix memory leaks
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-11-12 20:38:30 +01:00
Paul B Mahol 6665938ca8 avformat/ty: check if header is correctly parsed and is still present
Fixes #6829.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-11-12 20:29:26 +01:00
James Almer 349e9a8787 avformat/ty: fix format specifiers in debug log messages
Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-08 17:04:42 -03:00
Paul B Mahol a29a0aba79 avformat/ty: do not overread chunk
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-11-06 21:00:08 +01:00
Paul B Mahol cdd19e2c56 avformat/ty: try harder to find stream signature
Search all chunks, not just first one.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-11-06 20:50:16 +01:00
Paul B Mahol a6a6935ee8 avformat: add TiVo ty demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-11-06 18:20:29 +01:00