[FFmpeg-devel] [PATCH 1/2] avformat/mpegts: Factorize version checking code out

JULIAN GARDNER joolzg at btinternet.com
Wed Apr 29 22:44:36 CEST 2015


Its nice to see this added, but why 4 years ago when I pushed these same changes, was I told it was not being added because it would break older streams created with ffmpeg.
Has there been a change in policy now to try to adhere to specifications.
Just wondering boys as my personal build has had these and many more mpeg-ts changes running since i tried pushing these.
See: [FFmpeg-devel] New patch for mpegts.c

|   |
|   |   |   |   |   |
| [FFmpeg-devel] New patch for mpegts.c[FFmpeg-devel] New patch for mpegts.c JULIAN GARDNER joolzg at btinternet.com Wed Oct 24 21:30:34 CEST 2012 Previous message: [FFmpeg-devel] New patch for mpegts.c  |
|  |
| View on ffmpeg.org | Preview by Yahoo |
|  |
|   |

 


     On Wednesday, 29 April 2015, 22:31, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
   
 

 On Wed, Apr 29, 2015 at 10:24 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavformat/mpegts.c |  22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 0e5c2ba..d707cc3 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -580,6 +580,16 @@ typedef struct SectionHeader {
>      uint8_t last_sec_num;
>  } SectionHeader;
>
> +static int skip_identical(const SectionHeader *h, MpegTSSectionFilter *tssf)
> +{
> +    if (h->version == tssf->last_ver)
> +        return 1;
> +
> +    tssf->last_ver = h->version;
> +
> +    return 0;
> +}
> +
>  static inline int get8(const uint8_t **pp, const uint8_t *p_end)
>  {
>      const uint8_t *p;
> @@ -1469,9 +1479,8 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section,
>          return;
>      if (h.tid != M4OD_TID)
>          return;
> -    if (h.version == tssf->last_ver)
> +    if (skip_identical(&h, tssf))
>          return;
> -    tssf->last_ver = h.version;
>

I'm not sure this is better. Do you plan on extending the function
later or something?
Right now, it saves one line code, but makes the code less clear on
what it does, IMHO.

- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


 
  


More information about the ffmpeg-devel mailing list