[FFmpeg-devel] [PATCH] electronicarts: demux alpha stream
Michael Niedermayer
michaelni at gmx.at
Wed Jun 24 15:51:57 CEST 2015
On Wed, Jun 24, 2015 at 12:31:56AM +1000, Peter Ross wrote:
> .vp6 files may contain two video streams: one for the primary video
> stream and another for the alpha mask. The file format uses identical
> data structures for both streams.
>
> Signed-off-by: Peter Ross <pross at xvid.org>
> ---
> libavformat/electronicarts.c | 136 +++++++++++++++++++++++++------------------
> 1 file changed, 80 insertions(+), 56 deletions(-)
>
> diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
> index d999a0b..1c35e2d 100644
> --- a/libavformat/electronicarts.c
> +++ b/libavformat/electronicarts.c
> @@ -59,18 +59,25 @@
> #define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
> #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
> #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
> +#define AVhd_TAG MKTAG('A', 'V', 'h', 'd')
> +#define AV0K_TAG MKTAG('A', 'V', '0', 'K')
> +#define AV0F_TAG MKTAG('A', 'V', '0', 'F')
> #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') /* CMV header */
> #define MVIf_TAG MKTAG('M', 'V', 'I', 'f') /* CMV I-frame */
> #define AVP6_TAG MKTAG('A', 'V', 'P', '6')
>
> -typedef struct EaDemuxContext {
> - int big_endian;
> -
> - enum AVCodecID video_codec;
> +typedef struct VideoProperties {
> + enum AVCodecID codec;
> AVRational time_base;
> int width, height;
> int nb_frames;
> - int video_stream_index;
> + int stream_index;
> +} VideoProperties;
> +
> +typedef struct EaDemuxContext {
> + int big_endian;
> +
> + VideoProperties video, alpha;
>
> enum AVCodecID audio_codec;
> int audio_stream_index;
can you split the changes that are due to the
VideoProperties/EaDemuxContext change from the alpha stuff ?
that would make the then 2 commits more readable
also is there a sample/testcase available for this ?
Thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150624/34350452/attachment.asc>
More information about the ffmpeg-devel
mailing list