GNOME Bugzilla – Bug 726117
typefinding: issue in MPEG-TS detection logic for streams with Null Pids
Last modified: 2015-10-01 11:53:59 UTC
Created attachment 271535 [details] [review] Patch to correct MPEG-TS detection logic in Typefind The current TS detection logic in Typefind checks for the adaptation control field to be Non-Null to declare the TS as valid TS. However, there are TS files where adaptation control field is 0 for the packets with NULL pids. To resolve this an additional condition is needed that, if adapation control field is 0 and PID is NULL, then declare as a valid TS stream. Attaching the patch that is based on above suggestion.
Thanks for the patch. Could you make a small (< 1MB) sample of such an MPEG-TS stream available by any chance and attach it to this bug report? You can create one with: $ head --bytes=800k foo.ts > sample.ts
Created attachment 271727 [details] Attaching the sample file with Null PID packets Attaching the sample file with Null PID packets.
Thank you.
Review of attachment 271535 [details] [review]: Thanks for your patch and the sample. I couldn't find any reference to this field being 00 for valid streams though. 00 seems to be reserved. Can you provide more info on the rationale behind it? Regarding the patch, just two nits: ::: gst-plugins-base-0.10.34-orig/gst/typefind/gsttypefindfunctions.c @@ +1938,3 @@ #define MPEGTS_HDR_SIZE 4 /* Check for sync byte, error_indicator == 0 and packet has payload */ +/* Adaptation control filed (((data)[3] & 0x30) == 0x00) may be zero for TS packets with NULL PIDs. filed/field @@ +1939,3 @@ /* Check for sync byte, error_indicator == 0 and packet has payload */ +/* Adaptation control filed (((data)[3] & 0x30) == 0x00) may be zero for TS packets with NULL PIDs. + Still these streams are valid TS streams */ Still,
commit eaf4ce01d3be395ef88230f81382caaa0e678712 Author: Pankaj Darak <pankajdarak@gmail.com> Date: Thu Oct 1 12:32:33 2015 +0100 typefinding: mpeg-ts detection improvement Allow AFC to be 0 for null pid packets. https://bugzilla.gnome.org/show_bug.cgi?id=726117