rtpdec: Remove unnecessary checks
[ffmpeg.git] / libavformat / rtpdec_h263_rfc2190.c
index e4e4e21..ae6e38e 100644 (file)
@@ -39,15 +39,8 @@ struct PayloadContext {
     int          newformat;
 };
 
-static PayloadContext *h263_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
 static void h263_free_context(PayloadContext *data)
 {
-    if (!data)
-        return;
     if (data->buf) {
         uint8_t *p;
         avio_close_dyn_buf(data->buf, &p);
@@ -202,7 +195,7 @@ RTPDynamicProtocolHandler ff_h263_rfc2190_dynamic_handler = {
     .codec_id          = AV_CODEC_ID_H263,
     .need_parsing      = AVSTREAM_PARSE_FULL,
     .parse_packet      = h263_handle_packet,
-    .alloc             = h263_new_context,
+    .priv_data_size    = sizeof(PayloadContext),
     .free              = h263_free_context,
     .static_payload_id = 34,
 };