On 26/05/15 20:42, Andreas Cadhalpun wrote: > On 26.05.2015 15:40, Luca Barbato wrote: >> On 26/05/15 15:24, Vittorio Giovara wrote: >>> From: Andreas Cadhalpun <[email protected]> >>> >>> In this case the mov demuxer can return a large number of empty packets. >>> >>> Signed-off-by: Andreas Cadhalpun <[email protected]> >>> --- >>> libavformat/mov.c | 7 +++++++ >>> 1 file changed, 7 insertions(+) >>> >>> diff --git a/libavformat/mov.c b/libavformat/mov.c >>> index 99f57ec..99a6452 100644 >>> --- a/libavformat/mov.c >>> +++ b/libavformat/mov.c >>> @@ -2268,6 +2268,13 @@ static void mov_build_index(MOVContext *mov, >>> AVStream *st) >>> AVIndexEntry *e; >>> unsigned size, samples; >>> >>> + if (sc->samples_per_frame > 1 && !sc->bytes_per_frame) { >>> + avpriv_request_sample(mov->fc, >>> + "Zero bytes per frame, but %d samples per >>> frame", >>> + sc->samples_per_frame); >>> + return; >>> + } >>> + >>> if (sc->samples_per_frame >= 160) { // gsm >>> samples = sc->samples_per_frame; >>> size = sc->bytes_per_frame; >>> >> >> I'm not happy with it, > > I still don't understand what you don't like about it. > >> but I'm in general not happy with that function to begin with. > > The function doesn't return error codes, which is a bit strange.
Exactly that and I'm not sure if some user would want to get this stream even if is "absurd", thus why I'd rather either provide the packets marking them as corrupted or provide a switch by using our "explode" feature to drop, take or stop once you find them. Would be possible to have metadata-only empty packets this way? lu _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
