libavformat/oggdec.{c, h}: Add new_extradata, use it to pass extradata to the next decoded packet.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
791a333a0e
commit
ba3d4c2ba2
2 changed files with 13 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ static void free_stream(AVFormatContext *s, int i)
|
|||
|
||||
av_freep(&stream->private);
|
||||
av_freep(&stream->new_metadata);
|
||||
av_freep(&stream->new_extradata);
|
||||
}
|
||||
|
||||
//FIXME We could avoid some structure duplication
|
||||
|
|
@ -888,6 +889,16 @@ retry:
|
|||
os->new_metadata_size = 0;
|
||||
}
|
||||
|
||||
if (os->new_extradata) {
|
||||
ret = av_packet_add_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
|
||||
os->new_extradata, os->new_extradata_size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
os->new_extradata = NULL;
|
||||
os->new_extradata_size = 0;
|
||||
}
|
||||
|
||||
return psize;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ struct ogg_stream {
|
|||
int end_trimming; ///< set the number of packets to drop from the end
|
||||
uint8_t *new_metadata;
|
||||
size_t new_metadata_size;
|
||||
uint8_t *new_extradata;
|
||||
size_t new_extradata_size;
|
||||
void *private;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue