Changeset 2720 for trunk/src/objects


Ignore:
Timestamp:
Dec 6, 2011, 8:03:57 PM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/objects/RpVideo.c

    r2711 r2720  
    5858#define AVMEDIA_TYPE_VIDEO      CODEC_TYPE_VIDEO
    5959#define AV_PKT_FLAG_KEY         PKT_FLAG_KEY           
     60#define avio_close              url_fclose
     61#define avformat_open_input     av_open_input_file
    6062#endif  /* LIBAVUTIL_VERSION_MAJOR */
    6163
     
    341343     * Open the video stream from that file.
    342344     */
     345#if LIBAVUTIL_VERSION_MAJOR < 51
    343346    if (av_open_input_file(&vidPtr->pFormatCtx, vidPtr->fileName,
    344347            NULL, 0, NULL) != 0) {
    345         // Tcl_AppendResult(interp, "couldn't open file \"",
    346         //     fileName, "\"", (char*)NULL);
    347         // return TCL_ERROR;
    348 
    349         // couldn't open file
    350348        return -3;
    351349    }
     350#else
     351    if (avformat_open_input(&vidPtr->pFormatCtx, vidPtr->fileName, NULL,
     352        NULL) != 0) {
     353        return -3;
     354    }
     355#endif
    352356    if (av_find_stream_info(vidPtr->pFormatCtx) < 0) {
    353357        // Tcl_AppendResult(interp, "couldn't find streams in file \"",
     
    16681672
    16691673        if (vidPtr->outFormatCtx->pb) {
    1670             url_fclose(vidPtr->outFormatCtx->pb);
     1674            avio_close(vidPtr->outFormatCtx->pb);
    16711675        }
    16721676
Note: See TracChangeset for help on using the changeset viewer.