* If we can't get a video stream bitrate, leave it NULL instead of calling it 0.

This commit is contained in:
Justin Maggard 2009-06-30 02:01:34 +00:00
parent 6e9fdd9a94
commit 885427c569

View File

@ -650,7 +650,8 @@ GetVideoMetadata(const char * path, char * name)
{ {
DPRINTF(E_DEBUG, L_METADATA, "Container: '%s' [%s]\n", ctx->iformat->name, basename(path)); DPRINTF(E_DEBUG, L_METADATA, "Container: '%s' [%s]\n", ctx->iformat->name, basename(path));
asprintf(&m.resolution, "%dx%d", ctx->streams[video_stream]->codec->width, ctx->streams[video_stream]->codec->height); asprintf(&m.resolution, "%dx%d", ctx->streams[video_stream]->codec->width, ctx->streams[video_stream]->codec->height);
asprintf(&m.bitrate, "%u", ctx->bit_rate / 8); if( ctx->bit_rate > 8 )
asprintf(&m.bitrate, "%u", ctx->bit_rate / 8);
if( ctx->duration > 0 ) { if( ctx->duration > 0 ) {
duration = (int)(ctx->duration / AV_TIME_BASE); duration = (int)(ctx->duration / AV_TIME_BASE);
hours = (int)(duration / 3600); hours = (int)(duration / 3600);