]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/utils.c
avformat/avformat, utils: Make av_find_best_stream const-correct
[ffmpeg] / libavformat / utils.c
index ba664f6214d9171ed74bfdc4c000520c12ce01ac..2f66f539a693ddbfa92aa6893b49afd97f79131b 100644 (file)
@@ -4200,7 +4200,7 @@ AVProgram *av_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int
 
 int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
                         int wanted_stream_nb, int related_stream,
-                        AVCodec **decoder_ret, int flags)
+                        const AVCodec **decoder_ret, int flags)
 {
     int i, nb_streams = ic->nb_streams;
     int ret = AVERROR_STREAM_NOT_FOUND;
@@ -4260,7 +4260,7 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
         }
     }
     if (decoder_ret)
-        *decoder_ret = (AVCodec*)best_decoder;
+        *decoder_ret = best_decoder;
     return ret;
 }
 
@@ -4589,11 +4589,7 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
     return program;
 }
 
-#if FF_API_CHAPTER_ID_INT
-AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base,
-#else
 AVChapter *avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_base,
-#endif
                               int64_t start, int64_t end, const char *title)
 {
     AVChapter *chapter = NULL;
@@ -5466,7 +5462,7 @@ int ff_generate_avci_extradata(AVStream *st)
 }
 
 uint8_t *av_stream_get_side_data(const AVStream *st,
-                                 enum AVPacketSideDataType type, buffer_size_t *size)
+                                 enum AVPacketSideDataType type, size_t *size)
 {
     int i;
 
@@ -5519,7 +5515,7 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
 }
 
 uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
-                                 buffer_size_t size)
+                                 size_t size)
 {
     int ret;
     uint8_t *data = av_malloc(size);
@@ -5635,7 +5631,7 @@ int ff_standardize_creation_time(AVFormatContext *s)
 int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette)
 {
     uint8_t *side_data;
-    buffer_size_t size;
+    size_t size;
 
     side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_PALETTE, &size);
     if (side_data) {