OSDN Git Service

Merge commit '5d8cae45737bed6239bd6b6e0698802dbe1463c8'
[android-x86/external-ffmpeg.git] / libavformat / rtpdec_h261.c
index 9f34889..1555523 100644 (file)
@@ -32,11 +32,6 @@ struct PayloadContext {
     uint32_t     timestamp;
 };
 
-static av_cold PayloadContext *h261_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
 static void h261_free_dyn_buffer(AVIOContext **dyn_buf)
 {
     uint8_t *ptr_dyn_buffer;
@@ -60,17 +55,6 @@ static av_cold void h261_free_context(PayloadContext *pl_ctx)
     av_free(pl_ctx);
 }
 
-static av_cold int h261_init(AVFormatContext *ctx, int st_index,
-                             PayloadContext *data)
-{
-    if (st_index < 0)
-        return 0;
-
-    ctx->streams[st_index]->need_parsing = AVSTREAM_PARSE_FULL;
-
-    return 0;
-}
-
 static int h261_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_h261_ctx,
                               AVStream *st, AVPacket *pkt, uint32_t *timestamp,
                               const uint8_t *buf, int len, uint16_t seq,
@@ -194,8 +178,8 @@ RTPDynamicProtocolHandler ff_h261_dynamic_handler = {
     .enc_name          = "H261",
     .codec_type        = AVMEDIA_TYPE_VIDEO,
     .codec_id          = AV_CODEC_ID_H261,
-    .init              = h261_init,
-    .alloc             = h261_new_context,
+    .need_parsing      = AVSTREAM_PARSE_FULL,
+    .priv_data_size    = sizeof(PayloadContext),
     .free              = h261_free_context,
     .parse_packet      = h261_handle_packet,
     .static_payload_id = 31,