[vlc-devel] [PATCH] rtp: JPEG packetization
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri Oct 5 12:36:24 CEST 2012
On Thu, Oct 4, 2012 at 2:29 AM, Pierre Ynard <linkfanel at yahoo.fr> wrote:
> + /* a quantization table is 64 bytes long */
> + i_nb_qtables = GetWBE( &p_data[i + 2] ) / 65;
>
> Doesn't the length include the two bytes of the length field?
No, the length field is in the RTP/JPEG header of packets.
Here, I preparse the jpeg header in order to get some useful informations.
>
> + if( i + 4 + i_nb_qtables * 65 > i_data )
> + {
> + fprintf( stderr, "Too short JPEG header. Aborted!\n" );
> + return VLC_EGENERIC;
>
> Don't use fprintf(). Normally you'd use the msg_{Dbg,Warn,Err} functions
> to log messages, but I guess you can just drop them here.
Okay, but I prefer use some error/warning messages here, so I'll
replace fprintf by msg_.
>
> + }
> +
> + p_qtables = &p_data[i + 4];
>
> Instead of this pattern, you could just write "p_data + i + 4".
>
> Regards,
>
> --
> Pierre Ynard
> "Une âme dans un corps, c'est comme un dessin sur une feuille de papier."
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
--
Best regards,
Samuel Pitoiset.
More information about the vlc-devel
mailing list