[FFmpeg-devel] [PATCH] Adding support for parsing BlockAdditional
Michael Niedermayer
michaelni at gmx.at
Tue Feb 12 04:04:29 CET 2013
On Mon, Feb 11, 2013 at 04:05:29PM -0800, Vignesh Venkatasubramanian wrote:
> Matroska specification lists support for BlockAdditional element
> which is not supported by ffmpeg's matroska parser. This patch
> adds grammar definitions for parsing that element (and few other
> related elements) and then puts the data in AVPacket.side_data
> with new AVPacketSideDataType AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL.
[...]
> @@ -2111,6 +2128,18 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
> pkt->flags = is_keyframe;
> pkt->stream_index = st->index;
>
> + if (additional_size > 0) {
> + uint8_t *side_data = av_packet_new_side_data(pkt,
> + AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
> + additional_size + sizeof(additional_id));
> + if(side_data == NULL) {
> + return AVERROR(ENOMEM);
> + }
> + additional_id = htonl(additional_id);
> + memcpy(side_data, &additional_id, sizeof(additional_id));
htonl is 32bit but additional_id 64bit
which size did you want to use ?
also AV_WB32/64 is whats used in ffmpeg normally for such code
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130212/118003b1/attachment.asc>
More information about the ffmpeg-devel
mailing list