diff options
author | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-04-09 01:54:04 +0400 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-04-09 01:54:04 +0400 |
commit | 5d2bf0e0c483da0f72492442e0baf7f83c42dba9 (patch) | |
tree | 06ebb5c3844801a3b0b7faeb6eb5e997342bfe88 /metadata.c | |
parent | 459a19e918a266b5d82446a7dee9556d9940c490 (diff) |
* Make sure a couple pointers are initialized before use.
Diffstat (limited to 'metadata.c')
-rw-r--r-- | metadata.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -642,7 +642,7 @@ GetVideoMetadata(const char * path, char * name) int ret, i; struct tm *modtime; AVFormatContext *ctx; - AVCodecContext *ac, *vc; + AVCodecContext *ac = NULL, *vc = NULL; int audio_stream = -1, video_stream = -1; enum audio_profiles audio_profile = PROFILE_AUDIO_UNKNOWN; tsinfo_t *ts; @@ -691,7 +691,7 @@ GetVideoMetadata(const char * path, char * name) } } /* This must not be a video file. */ - if( video_stream == -1 ) + if( !vc ) { av_close_input_file(ctx); if( !is_audio(path) ) @@ -717,7 +717,7 @@ GetVideoMetadata(const char * path, char * name) strftime(m.date, 20, "%FT%T", modtime); } - if( audio_stream >= 0 ) + if( ac ) { switch( ac->codec_id ) { @@ -805,7 +805,7 @@ GetVideoMetadata(const char * path, char * name) #endif asprintf(&m.channels, "%u", ac->channels); } - if( video_stream >= 0 ) + if( vc ) { DPRINTF(E_DEBUG, L_METADATA, "Container: '%s' [%s]\n", ctx->iformat->name, basename(path)); asprintf(&m.resolution, "%dx%d", vc->width, vc->height); |