~ubuntu-branches/debian/sid/gmtp/sid

« back to all changes in this revision

Viewing changes to src/metatag_info.c

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-06-14 10:12:49 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120614101249-sds3t0jzopmywdvm
Tags: 1.3.2-1
* New upstream bugfix release:
  - Correct Makefile to fix when building with GTK+-3.4.
  - Reworked pkg-config handling to respect $(PKG_CONFIG) in Makefile.
  - Add additional error checking on connection of new devices, to hopefully
    avoid seg-fault with some very problematic devices. Ubuntu bugs:
    LP: #917314 LP: #948621 LP: #968798 LP: #995503
  - Fix issue with some Android 3.2 implementations and GetStorage() MTP API
    function. (Uses cached information, rather than full item rescan in some
    instances). (Closes: #667795)
  - Correct German Translations. (Closes: #672298)
  - Fix FLAC file handling.
* Update debian/copyright.
* Bump Standards.
* Drop 0001-missing_linker_flag.patch, applied upstream.
* Enable harden'd compilation.
* Add 0002-format_security.patch to prevent build failure with the flag
  '-Werror=format-security' enabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *
3
3
 *   File: metatag_info.c
4
4
 *
5
 
 *   Copyright (C) 2009-2011 Darran Kartaschew
 
5
 *   Copyright (C) 2009-2012 Darran Kartaschew
6
6
 *
7
7
 *   This file is part of the gMTP package.
8
8
 *
507
507
    }
508
508
 
509
509
    // Duration, bitrate and other information
 
510
    if((streaminfo.data.stream_info.sample_rate != 0)&&(streaminfo.data.stream_info.total_samples != 0)){
510
511
    trackinformation->duration = (streaminfo.data.stream_info.total_samples /
511
512
        streaminfo.data.stream_info.sample_rate) * 1000;
512
513
    trackinformation->bitrate = 8.0 * (float) (trackinformation->filesize) /
513
514
        (1000.0 * (float) streaminfo.data.stream_info.total_samples
514
515
        / (float) streaminfo.data.stream_info.sample_rate);
 
516
    } else {
 
517
        trackinformation->duration = 0;
 
518
        trackinformation->bitrate = 0;
 
519
    }
515
520
    trackinformation->bitratetype = 0; // Not used
516
521
    trackinformation->nochannels = streaminfo.data.stream_info.channels;
517
522
 
518
523
    //trackinformation->tracknumber = atoi(FLAC_getFieldText(tags, "TRACKNUMBER"));
519
524
    FLAC__metadata_object_delete(tags);
520
 
    FLAC__metadata_object_delete(&streaminfo);
 
525
    //FLAC__metadata_object_delete(&streaminfo);
521
526
    return;
522
527
}
523
528