After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752760 - qtdemux: Fix wrong setting of max_buffer_size for LPCM files.
qtdemux: Fix wrong setting of max_buffer_size for LPCM files.
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.4.5
Other Linux
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
https://people.collabora.com/~nicolas...
Depends on: 752613
Blocks:
 
 
Reported: 2015-07-23 06:50 UTC by manasa.athreya
Modified: 2018-11-03 15:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This is part of split file with md5sum e476e8c5f12498d1dff4735732900aa5 (1.00 MB, video/quicktime)
2015-07-23 06:50 UTC, manasa.athreya
  Details
This is a part of split file with md5sum e476e8c5f12498d1dff4735732900aa5 (1.00 MB, application/octet-stream)
2015-07-23 06:51 UTC, manasa.athreya
  Details
This is a part of split file with md5sum e476e8c5f12498d1dff4735732900aa5 (185.30 KB, image/jpeg)
2015-07-23 06:52 UTC, manasa.athreya
  Details
This is the diff patch (633 bytes, patch)
2015-07-23 06:53 UTC, manasa.athreya
none Details | Review
This is the diff patch (2.23 KB, patch)
2015-07-28 04:20 UTC, manasa.athreya
none Details | Review
fix reverse playback of large samples (eg, LPCM) (1.91 KB, patch)
2016-08-02 14:08 UTC, Vincent Penquerc'h
none Details | Review

Description manasa.athreya 2015-07-23 06:50:40 UTC
Created attachment 307964 [details]
This is part of split file with md5sum e476e8c5f12498d1dff4735732900aa5

Overview:

The max_buffer_size of LPCM files was set wrongly because qtdemux hardcoded the sampling rate as 4096.

Steps to Reproduce: 

1) Play the attached MOV file.
2) Then, do Rewind.

Actual Results: 
On Rewind, "Invalid file and cannot be played" error message is triggered.

Expected Results: 
1) Rewind should not result in error.
2) Frames should move in appropriate play speed.

Build Date & Hardware: 
Build 2014-12-18 on Ubuntu 12.04
Comment 1 manasa.athreya 2015-07-23 06:51:41 UTC
Created attachment 307965 [details]
This is a part of split file with md5sum e476e8c5f12498d1dff4735732900aa5
Comment 2 manasa.athreya 2015-07-23 06:52:08 UTC
Created attachment 307966 [details]
This is a part of split file with md5sum e476e8c5f12498d1dff4735732900aa5
Comment 3 manasa.athreya 2015-07-23 06:53:58 UTC
Created attachment 307969 [details] [review]
This is the diff patch
Comment 4 manasa.athreya 2015-07-28 04:20:02 UTC
Created attachment 308280 [details] [review]
This is the diff patch
Comment 5 Tim-Philipp Müller 2015-07-28 08:04:25 UTC
Thanks. Is this the right sample file to reproduce the bug with?
Comment 6 manasa.athreya 2015-07-28 08:34:26 UTC
Obviously :)No doubt
Comment 7 Nicolas Dufresne (ndufresne) 2016-02-09 23:15:15 UTC
Apparently the author of this 4096 hardcode new this was not working well:

commit 5bd2864101d837642fe37244aab58ab29dbca37a
Author: David Schleef <ds@schleef.org>
Date:   Tue Mar 5 17:00:17 2013 -0800

    qtdemux: split large raw audio samples
    
    In order to deal with a file that has samples that are 24 seconds
    long.  Seeking still doesn't work with such files.

Though your patch is a little strange, it feels like it hides another bug. bytes_per_frame sound like the frame size which iirc is defined as:

  framesize = num_channels * rate * sample_size

If your framesize is correct, splitting your audio buffers in any multiple of that value should be fine (so 4096 * framesize, should be a valid value, it's complitly arbitrary, but valid).

But digging up the code I found this (line 9610):

  stream->bytes_per_frame = stream->n_channels * stream->bytes_per_sample;

Isn't this where the bug is in fact ? (also, don't put indent changes along with patches).
Comment 8 Nicolas Dufresne (ndufresne) 2016-02-09 23:24:38 UTC
To assembled the stream, and made it available here:
  https://people.collabora.com/~nicolas/test-lpcm.mov

To reproduce, start with gst-play-1.0 and then press 'd'
Comment 9 Nicolas Dufresne (ndufresne) 2016-02-09 23:29:06 UTC
My memory is bugging me, obviously a frame size is:
  num_channels * sample_size

So basically, instead of picking a random number of samples, you decide to make it at most 1 second ?
Comment 10 Nicolas Dufresne (ndufresne) 2016-02-09 23:31:28 UTC
Even though it removes the error, that cause huge audio noise here, so something isn't right yet.
Comment 11 Vincent Penquerc'h 2016-04-20 10:25:28 UTC
The problem is likely elsewhere, as forward playback on tha sample file gets the same 16000 size and yet audio plays fine.
Comment 12 Vincent Penquerc'h 2016-08-02 14:08:51 UTC
Created attachment 332562 [details] [review]
fix reverse playback of large samples (eg, LPCM)

That sounds plausibly like backwards playback, and doesn't have any noise. There is a bit of pause at the end/start, so there might be another bug in the area with the timing.
Comment 13 GStreamer system administrator 2018-11-03 15:02:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/205.